Home

Awesome

karma-espower-preprocessor

Preprocess source code by espower-source

sample

Installation

npm install karma-espower-preprocessor --save-dev

I'm recommend to use with karma-sourcemap-loader if you use some altJS.

Configuration

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

    espowerPreprocessor: {
      options: {
        // emit espowerified code.
        // default: false (in-memory)
        emitActualCode: true,
        // ignore upstream SourceMap info.
        // default: false
        ignoreUpstreamSourceMap: false
      },
      transformPath: function(path) {
        // default
        return path.replace(/\.js$/, '.espowered.js');
      }
    }
  });
};