karma-6to5-preprocessor
v3.0.1
Published
Preprocessor to compile ES6 on the fly with 6to5.
Downloads
15
Readme
karma-6to5-preprocessor
Preprocessor to compile ES6 on the fly with 6to5.
Installation
npm install karma-6to5-preprocessor --save-dev
Configuration
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.
filename
sourceRoot
sourceMapName
sourceFileName
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;
}
}
});
};