Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webpack and ect-loader basic usage example on README.md #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cusspvz
Copy link

@cusspvz cusspvz commented Sep 22, 2015

ect-loader

ect templates compiler for webpack

Motivation

ectjs is one of the fastest templating libraries out there,
but not so well known by the community.

As there wasn't a loader for webpack, I've decided to build one before going to
bed. Here it is, show your apretiation by starring the project, tweeting and
enjoy using it.

Installation

npm i --save-dev ect-loader

Usage

Documentation: Using loaders

Example config

This webpack config can compile ect templates for you to use on your browser
without having to load ECT and CoffeeScript browser versions.

module.exports = {
  module: {
    loaders: [
      { test: /\.ect$/, loader: "ect" }
    ]
  }
};

Minification

This loader minifies template before compiling in case you're running with
performance enhancment option (webpack -p).

It works by cutting off spaces between HTML tags and line-breaks.

Source Example

<div id="testing">
    <%- __ "Read the docs" %>
</div>

Minified output

<div id="testing"> Lê a documentação </div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant