Replace node polyfills configuration with dummy fallback

They removed default polyfills but some dependecies require those
so this replaces those modules.
See https://webpack.js.org/migrate/5/#clean-up-configuration

[MAILPOET-3214]
This commit is contained in:
Rostislav Wolny
2021-09-08 15:37:29 +02:00
committed by Veljko V
parent 48f4c6ab64
commit 010bc3b8d8

View File

@@ -41,6 +41,9 @@ const baseConfig = {
'node_modules',
'assets/js/src',
],
fallback: {
fs: false,
},
extensions: ['.js', '.jsx', '.ts', '.tsx'],
alias: {
'handlebars': 'handlebars/dist/handlebars.js',
@@ -56,9 +59,6 @@ const baseConfig = {
'asyncqueue': 'vendor/jquery.asyncqueue.js',
},
},
node: {
fs: 'empty'
},
plugins: [],
module: {
noParse: /node_modules\/lodash\/lodash\.js/,
@@ -351,6 +351,9 @@ const testConfig = {
'blob$': 'blob-tmp/Blob.js',
'wp-js-hooks': path.resolve(__dirname, 'assets/js/src/hooks.js'),
},
fallback: {
fs: false,
},
},
externals: {
'jquery': 'jQuery',