https://github.com/settinghead/karma-eco-preprocessor
https://github.com/settinghead/karma-eco-preprocessor
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/settinghead/karma-eco-preprocessor
- Owner: settinghead
- License: mit
- Created: 2013-12-19T08:13:12.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-13T08:15:44.000Z (about 12 years ago)
- Last Synced: 2025-02-16T09:03:05.480Z (about 1 year ago)
- Language: JavaScript
- Size: 165 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# karma-eco-preprocessor
> Preprocessor to compile ECO Templates. Source code derived from [Karma HTML2JS Preprocessor](https://github.com/karma-runner/karma-html2js-preprocessor)
## Installation
The easiest way is to keep `karma-eco-preprocessor` as a devDependency in your `package.json`.
```json
{
"devDependencies": {
"karma": "~0.10",
"karma-eco-preprocessor": "~0.1"
}
}
```
You can simple do it by:
```bash
npm install karma-eco-preprocessor --save-dev
```
## Configuration
Following code shows the default configuration...
```js
// 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].
[homepage]: http://karma-runner.github.com