Exclude packaged modules from transpiling (webpack/babel-loader)

This commit is contained in:
Pirate Praveen 2020-04-11 19:51:50 +05:30
parent 63298a3ec1
commit f2c54b1123

View file

@ -25,7 +25,7 @@
}, },
module: { module: {
@@ -166,9 +165,12 @@ @@ -166,9 +165,13 @@
}, },
{ {
test: /\.js$/, test: /\.js$/,
@ -33,13 +33,14 @@
+ exclude: [ path => + exclude: [ path =>
/node_modules\/(?!tributejs)|node_modules|vendor[\\/]assets/.test(path) && /node_modules\/(?!tributejs)|node_modules|vendor[\\/]assets/.test(path) &&
!/\.vue\.js/.test(path), !/\.vue\.js/.test(path),
+ /\bcore-js\b/, + /\/usr\/share\/nodejs/,
+ /\bwebpack\/buildin\b/ + /\/usr\/lib\/nodejs/,
+ /\/usr\/share\/javascript/
+ ], + ],
loader: 'babel-loader', loader: 'babel-loader',
options: { options: {
cacheDirectory: path.join(CACHE_PATH, 'babel-loader'), cacheDirectory: path.join(CACHE_PATH, 'babel-loader'),
@@ -475,19 +477,6 @@ @@ -475,19 +478,6 @@
// enable HMR only in webpack-dev-server // enable HMR only in webpack-dev-server
DEV_SERVER_LIVERELOAD && new webpack.HotModuleReplacementPlugin(), DEV_SERVER_LIVERELOAD && new webpack.HotModuleReplacementPlugin(),
@ -59,7 +60,7 @@
new webpack.DefinePlugin({ new webpack.DefinePlugin({
// This one is used to define window.gon.ee and other things properly in tests: // This one is used to define window.gon.ee and other things properly in tests:
'process.env.IS_EE': JSON.stringify(IS_EE), 'process.env.IS_EE': JSON.stringify(IS_EE),
@@ -513,6 +502,7 @@ @@ -513,6 +503,7 @@
node: { node: {
fs: 'empty', // sqljs requires fs fs: 'empty', // sqljs requires fs