Skip to content

settinghead/karma-eco-preprocessor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karma-eco-preprocessor

Preprocessor to compile ECO Templates. Source code derived from Karma HTML2JS Preprocessor

Installation

The easiest way is to keep karma-eco-preprocessor as a devDependency in your package.json.

{
  "devDependencies": {
    "karma": "~0.10",
    "karma-eco-preprocessor": "~0.1"
  }
}

You can simple do it by:

npm install karma-eco-preprocessor --save-dev

Configuration

Following code shows the default configuration...

// karma.conf.js
var path = require('path');
module.exports = function(config) {
  config.set({
    preprocessors: {
      '**/*.eco': ['eco']
    },

    ecoPreprocessor: {
      // options passed to the eco compiler
      options: {
        baseTemplatePath: path.join(__dirname, 'app/assets/templates'),
        enableJSTGlobalVariable: true
      },
      // transforming the filenames
      transformPath: function(path) {
        return path.replace(/\.js$/, '.eco');
      }
    }
  });
};

For more information on Karma see the homepage.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published