Skip to content

Commit f0570bf

Browse files
author
lizhigao
committed
fixed: Webpack ReferenceError: process is not defined SimulatedGREG/electron-vue#871
1 parent 5dcced7 commit f0570bf

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.electron-vue/webpack.renderer.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,18 @@ let rendererConfig = {
125125
new HtmlWebpackPlugin({
126126
filename: 'index.html',
127127
template: path.resolve(__dirname, '../src/index.ejs'),
128+
templateParameters(compilation, assets, options) {
129+
return {
130+
compilation: compilation,
131+
webpack: compilation.getStats().toJson(),
132+
webpackConfig: compilation.options,
133+
htmlWebpackPlugin: {
134+
files: assets,
135+
options: options,
136+
},
137+
process,
138+
};
139+
},
128140
minify: {
129141
collapseWhitespace: true,
130142
removeAttributeQuotes: true,

.electron-vue/webpack.web.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ let webConfig = {
9797
new HtmlWebpackPlugin({
9898
filename: 'index.html',
9999
template: path.resolve(__dirname, '../src/index.ejs'),
100+
templateParameters(compilation, assets, options) {
101+
return {
102+
compilation: compilation,
103+
webpack: compilation.getStats().toJson(),
104+
webpackConfig: compilation.options,
105+
htmlWebpackPlugin: {
106+
files: assets,
107+
options: options,
108+
},
109+
process,
110+
};
111+
},
100112
minify: {
101113
collapseWhitespace: true,
102114
removeAttributeQuotes: true,

0 commit comments

Comments
 (0)