Skip to content

Commit 7028657

Browse files
committed
chore(webpack): cleanup node polyfills
Signed-off-by: Richard Steinmetz <[email protected]>
1 parent 2de7e60 commit 7028657

File tree

3 files changed

+37
-21
lines changed

3 files changed

+37
-21
lines changed

package-lock.json

+30-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"@riophae/vue-treeselect": "^0.4.0",
5353
"@vue/babel-preset-app": "^5.0.8",
5454
"address-rfc2822": "^2.1.0",
55-
"buffer": "^6.0.3",
5655
"color-convert": "^2.0.1",
5756
"core-js": "^3.34.0",
5857
"debounce-promise": "^3.1.2",
@@ -72,9 +71,7 @@
7271
"process": "^0.11.10",
7372
"ramda": "^0.29.1",
7473
"raw-loader": "^4.0.2",
75-
"stream-browserify": "^3.0.0",
7674
"stylelint": "^15.11.0",
77-
"util": "^0.12.5",
7875
"uuid": "^9.0.1",
7976
"v-tooltip": "^2.1.3",
8077
"vue": "^2.7.15",

webpack.common.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const CKEditorWebpackPlugin = require('@ckeditor/ckeditor5-dev-webpack-plugin')
33
const { styles } = require('@ckeditor/ckeditor5-dev-utils')
44
const { VueLoaderPlugin } = require('vue-loader')
55
const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')
6-
const { ProvidePlugin } = require('webpack')
6+
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
77

88
function getPostCssConfig(ckEditorOpts) {
99
// CKEditor is not compatbile with postcss@8 and postcss-loader@4 despite stating so.
@@ -19,11 +19,12 @@ const plugins = [
1919
language: 'en',
2020
}),
2121
new VueLoaderPlugin(),
22-
new ProvidePlugin({
23-
// Make a global `process` variable that points to the `process` package,
24-
// because the `util` package expects there to be a global variable named `process`.
25-
// Thanks to https://stackoverflow.com/a/65018686/14239942
26-
process: 'process/browser.js',
22+
23+
// Make sure we auto-inject node polyfills on demand
24+
// https://webpack.js.org/blog/2020-10-10-webpack-5-release/#automatic-nodejs-polyfills-removed
25+
new NodePolyfillPlugin({
26+
// Console is available in the web-browser
27+
excludeAliases: ['console'],
2728
}),
2829
]
2930

@@ -107,10 +108,5 @@ module.exports = {
107108
resolve: {
108109
extensions: ['*', '.js', '.vue', '.json'],
109110
symlinks: false,
110-
fallback: {
111-
buffer: require.resolve('buffer/'),
112-
stream: require.resolve('stream-browserify'),
113-
util: require.resolve('util/'),
114-
},
115111
},
116112
}

0 commit comments

Comments
 (0)