diff --git a/package-lock.json b/package-lock.json index 28187be98c..3123310c2b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,6 +61,7 @@ "node-forge": "^1.3.1", "p-limit": "^4.0.0", "printscout": "2.0.3", + "process": "^0.11.10", "ramda": "^0.28.0", "raw-loader": "^4.0.2", "stream-browserify": "^3.0.0", diff --git a/package.json b/package.json index 4b33e59f67..2c8eefb4b1 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "node-forge": "^1.3.1", "p-limit": "^4.0.0", "printscout": "2.0.3", + "process": "^0.11.10", "ramda": "^0.28.0", "raw-loader": "^4.0.2", "stream-browserify": "^3.0.0", diff --git a/webpack.common.js b/webpack.common.js index 3f3288614d..fc6cebfbc6 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -3,6 +3,7 @@ const CKEditorWebpackPlugin = require('@ckeditor/ckeditor5-dev-webpack-plugin') const { styles } = require('@ckeditor/ckeditor5-dev-utils') const { VueLoaderPlugin } = require('vue-loader') const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except') +const { ProvidePlugin } = require('webpack') function getPostCssConfig(ckEditorOpts) { // CKEditor is not compatbile with postcss@8 and postcss-loader@4 despite stating so. @@ -18,6 +19,12 @@ const plugins = [ language: 'en', }), new VueLoaderPlugin(), + new ProvidePlugin({ + // Make a global `process` variable that points to the `process` package, + // because the `util` package expects there to be a global variable named `process`. + // Thanks to https://stackoverflow.com/a/65018686/14239942 + process: 'process/browser.js', + }), ] module.exports = {