specify file types

This commit is contained in:
Iuri Matias 2017-01-15 13:53:35 -05:00
parent 84a37da74b
commit 02c46cd72a
1 changed files with 1 additions and 5 deletions

View File

@ -6,16 +6,12 @@ require("babel-preset-es2017");
module.exports = function(embark) {
embark.registerPipeline(function(opts) {
embark.registerPipeline((embark.pluginConfig.files || ['*.js', '*.jsx']), function(opts) {
var targetFile = opts.targetFile;
var source = opts.source;
var presets = embark.pluginConfig.presets || ['es2015', 'es2016', 'es2017', 'react'];
var minified = (embark.pluginConfig.minified !== undefined ? embark.pluginConfig.minified : true);
if (targetFile.split('.').slice(-1)[0] !== 'js' ) {
return source;
}
return babel.transform(source, {minified: minified, presets: presets}).code;
});