From 02c46cd72a6c39dd38551abd3cf0e7ab90e2d908 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 15 Jan 2017 13:53:35 -0500 Subject: [PATCH] specify file types --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index e5e8c86..0dbfa9c 100644 --- a/index.js +++ b/index.js @@ -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; });