Commit 3d364128 authored by Philipp Nowinski's avatar Philipp Nowinski

[BUGFIX] only transform specifically sepcified node_modules

parent 4dd3522f
......@@ -7,6 +7,7 @@ const mkdirp = require('mkdirp');
const globby = require('globby');
const browserify = require('browserify');
const babelify = require('babelify');
const tfilter = require('tfilter');
const tinyify = require('tinyify');
const CLIEngine = require('eslint').CLIEngine;
const LintingFormatter = require('../lintingFormatter');
......@@ -134,7 +135,22 @@ module.exports = class Js extends Task {
let bundler = browserify(_input, {
paths: this._config.js.libraryPaths,
debug: this._config.jsPipeline.sourceMaps
}).transform(babelify, {
}).transform(tfilter(babelify, {
filter: (fileName) => {
if (fileName.indexOf('node_modules') >= 0) {
if (!this._config.js.transpiler) {
return true;
}
const modulesToCompile = this._config.js.transpiler.node_modules;
if (modulesToCompile) {
for (let moduleName of modulesToCompile) {
return fileName.indexOf(moduleName) >= 0
}
}
}
return true;
}
}), {
global: true,
presets: [
[require('@babel/preset-env'), presetEnvConfiguration],
......
{
"name": "@sgalinski/sgc",
"version": "3.5.21",
"version": "3.6.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -11250,6 +11250,11 @@
"safe-buffer": "^5.0.1"
}
},
"shallow-copy": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz",
"integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA="
},
"shasum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz",
......@@ -14677,6 +14682,17 @@
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
"integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ="
},
"tfilter": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/tfilter/-/tfilter-1.0.1.tgz",
"integrity": "sha512-DM7D7yTzgXDKWz1/BOwhbpyf1AUWwBa4iemjZ0rRjtgt2S4vM+Dd/uQbf2006+T/KI1dKF/WDR5UiY5AfbdkBw==",
"requires": {
"defined": "^1.0.0",
"minimatch": "^3.0.4",
"resolve": "^1.5.0",
"shallow-copy": "0.0.1"
}
},
"tfunk": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/tfunk/-/tfunk-3.1.0.tgz",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment