Bug 1356586 - Properly exclude dirs for babel transpilation; r=rickychien

MozReview-Commit-ID: E2iLUstNiZq

--HG--
extra : rebase_source : 45bb2d458bde55e7290a9cfbff90a34a05b6d301
This commit is contained in:
Jan Odvarko 2017-04-14 18:11:49 +02:00
parent 875f27030a
commit f1d56688d3

View File

@ -115,9 +115,11 @@ const mappings = [
webpackConfig.plugins = mappings.map(([regex, res]) =>
new NormalModuleReplacementPlugin(regex, res));
// Exclude to transplie all scripts in devtools/ but not for this folder
webpackConfig.babelExcludes = new RegExp(
`^${path.join(__dirname, "../../")}(.(?!${path.basename(__dirname)}))*$`);
// Exclude to transpile all scripts in devtools/ but not for this folder
const basePath = path.join(__dirname, "../../").replace(/\\/g, "\\\\");
const baseName = path.basename(__dirname);
webpackConfig.babelExcludes = new RegExp(`^${basePath}(.(?!${baseName}))*$`);
let config = toolboxConfig(webpackConfig, getConfig());
// Remove loaders from devtools-launchpad's webpack.config.js