Skip to content

Commit ab1ce52

Browse files
authored
fix: Handle eval removal properly, remove "remove-evals" script and WebpackShellPlugin (Kocal#398)
* fix(webpack): define `global` as `window` to prevent eval() issues This way, we get rid of "remove-evals" script that was sometimes working and sometimes not. * chore: remove WebpackShellPlugin & "remove-evals" script
1 parent 01066ba commit ab1ce52

File tree

3 files changed

+4
-61
lines changed

3 files changed

+4
-61
lines changed

template/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
"vue-template-compiler": "^2.5.17",
9090
"webpack": "^4.20.2",
9191
"webpack-chrome-extension-reloader": "^0.8.3",
92-
"webpack-cli": "^3.1.2",
93-
"webpack-shell-plugin": "^0.5.0"
92+
"webpack-cli": "^3.1.2"
9493
}
9594
}

template/scripts/remove-evals.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

template/webpack.config.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const webpack = require('webpack');
22
const ejs = require('ejs');
33
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4-
const WebpackShellPlugin = require('webpack-shell-plugin');
54
const CopyWebpackPlugin = require('copy-webpack-plugin');
65
const ChromeExtensionReloader = require('webpack-chrome-extension-reloader');
76
const { VueLoaderPlugin } = require('vue-loader');
@@ -55,6 +54,9 @@ const config = {
5554
],
5655
},
5756
plugins: [
57+
new webpack.DefinePlugin({
58+
global: 'window',
59+
}),
5860
new VueLoaderPlugin(),
5961
new MiniCssExtractPlugin({
6062
filename: '[name].css',
@@ -78,9 +80,6 @@ const config = {
7880
},
7981
},
8082
]),
81-
new WebpackShellPlugin({
82-
onBuildEnd: ['node scripts/remove-evals.js'],
83-
}),
8483
],
8584
};
8685

0 commit comments

Comments
 (0)