commit c335099465f5587e26cf1804652a8fa985ba8056
parent f98ccdee46005a0a51c0f0f89fcf824e91a2253f
Author: Tom Najdek <tom@doppnet.com>
Date: Sat, 3 Jun 2017 16:50:10 +0100
Add support for glob in babel-worker ignored paths
* Also fixes an issue with handling paths on Windows
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/gulp/babel-worker.js b/gulp/babel-worker.js
@@ -4,6 +4,7 @@
const fs = require('fs');
const path = require('path');
const babel = require('babel-core');
+const minimatch = require('minimatch')
const mkdirp = require('mkdirp');
const options = JSON.parse(fs.readFileSync('.babelrc'));
@@ -18,7 +19,7 @@ onmessage = (ev) => {
var transformed;
if(sourcefile === 'resource/react-dom.js') {
transformed = data.replace(/ownerDocument\.createElement\((.*?)\)/gi, 'ownerDocument.createElementNS(DOMNamespaces.html, $1)');
- } else if('ignore' in options && options.ignore.includes(sourcefile)) {
+ } else if('ignore' in options && options.ignore.some(ignoreGlob => minimatch(sourcefile, ignoreGlob))) {
transformed = data;
isSkipped = true;
} else {
diff --git a/package.json b/package.json
@@ -43,6 +43,7 @@
"gulp-tap": "^1.0.1",
"gulp-util": "^3.0.7",
"merge-stream": "^1.0.1",
+ "minimatch": "^3.0.4",
"mocha": "^3.4.2",
"sinon": "^2.3.1",
"through2": "^2.0.1",