@@ -3,7 +3,7 @@ const CKEditorWebpackPlugin = require('@ckeditor/ckeditor5-dev-webpack-plugin')
3
3
const { styles } = require ( '@ckeditor/ckeditor5-dev-utils' )
4
4
const { VueLoaderPlugin } = require ( 'vue-loader' )
5
5
const BabelLoaderExcludeNodeModulesExcept = require ( 'babel-loader-exclude-node-modules-except' )
6
- const { ProvidePlugin } = require ( 'webpack' )
6
+ const NodePolyfillPlugin = require ( 'node-polyfill- webpack-plugin ' )
7
7
8
8
function getPostCssConfig ( ckEditorOpts ) {
9
9
// CKEditor is not compatbile with postcss@8 and postcss-loader@4 despite stating so.
@@ -19,11 +19,12 @@ const plugins = [
19
19
language : 'en' ,
20
20
} ) ,
21
21
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' ] ,
27
28
} ) ,
28
29
]
29
30
@@ -107,10 +108,5 @@ module.exports = {
107
108
resolve : {
108
109
extensions : [ '*' , '.js' , '.vue' , '.json' ] ,
109
110
symlinks : false ,
110
- fallback : {
111
- buffer : require . resolve ( 'buffer/' ) ,
112
- stream : require . resolve ( 'stream-browserify' ) ,
113
- util : require . resolve ( 'util/' ) ,
114
- } ,
115
111
} ,
116
112
}
0 commit comments