Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

wilsonjackson/karma-wrap-preprocessor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karma-wrap-preprocessor Build Status

Wrap files with a lodash template.

Installation

npm install --save-dev karma-wrap-preprocessor

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    files: [
      'app/**/*.js',
      'test/**/*.js'
    ],

    preprocessors: {
      'app/**/*.js': ['wrap']
    },

    wrapPreprocessor: {
      // Example: wrap each file in an IIFE
      template: '(function () { <%= contents %> })()',

      // Other options:

      // Use an external template file instead of an inline string:
      file: 'path/to/tpl.txt',

      // Change the variable replaced by file contents (default value is 'contents'):
      variable: 'file',

      // Pass options to lodash template function (see https://lodash.com/docs#template):
      options: {}
    }
  });
};

License

MIT

About

Wrap files with a lodash template.

Resources

Stars

Watchers

Forks

Packages

No packages published