khc

karma-haml-coffee-preprocessor

Karma preprocessor for haml coffee

Showing:

Popularity

Downloads/wk

46

GitHub Stars

0

Maintenance

Last Commit

7yrs ago

Contributors

2

Package

Dependencies

2

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

karma-haml-coffee-preprocessor

Preprocessor to compile haml coffee templates on the fly.

Installation

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

{
  "devDependencies": {
    "karma": "~0.10",
    "karma-haml-coffee-preprocessor": "~0.2"
  }
}

You can simple do it by:

npm install karma-haml-coffee-preprocessor --save-dev

Configuration

Following code shows the default configuration...

// karma.conf.js
module.exports = function(config) {
  config.set({
    preprocessors: {
      '**/*.hamlc': ['hamlc']
    },

    coffeePreprocessor: {
      // options passed to the haml-coffee compiler
      options: {
        namespace: "window.JST",
        logicalPathStrip: "templates"
      },
      // Removes base and sprockets until logicalMountPath with options.logicalPathStrip
      transformLogicalPath: function(filepath) {
        var logicalPath = filepath.replace(/\.jst.hamlc/, '');
        return logicalPath.substring(logicalPath.indexOf(options.logicalPathStrip));
      }
    }
  });
};

For more information on Karma see the homepage.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial