3.0.1 • Published 11 years ago
karma-6to5-preprocessor v3.0.1
karma-6to5-preprocessor
Preprocessor to compile ES6 on the fly with 6to5.
Installation
npm install karma-6to5-preprocessor --save-devConfiguration
See 6to5 options for more details.
Given options properties are passed to 6to5.
In addition to the options property, you can configure the following options with functions because they may differ from file to file.
filenamesourceRootsourceMapNamesourceFileName
For example, inline sourcemap configuration would look like the following.
module.exports = function(config) {
config.set({
files: [
'src/**/*.js',
'test/**/*.js'
],
preprocessors: {
'src/**/*.js': ['6to5'],
'test/**/*.js': ['6to5']
},
'6to5Preprocessor': {
options: {
sourceMap: 'inline'
},
filename: function(file) {
return file.originalPath.replace(/\.js$/, '.es5.js');
},
sourceFileName: function(file) {
return file.originalPath;
}
}
});
};