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