Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 51d6443

Browse files
wjf2016wujianfu
and
wujianfu
authored
修复 ReferenceError: process is not defined 问题 (SimulatedGREG#1020)
Co-authored-by: wujianfu <[email protected]>
1 parent 45a3e22 commit 51d6443

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

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

+12
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@ let rendererConfig = {
129129
new HtmlWebpackPlugin({
130130
filename: 'index.html',
131131
template: path.resolve(__dirname, '../src/index.ejs'),
132+
templateParameters(compilation, assets, options) {
133+
return {
134+
compilation: compilation,
135+
webpack: compilation.getStats().toJson(),
136+
webpackConfig: compilation.options,
137+
htmlWebpackPlugin: {
138+
files: assets,
139+
options: options,
140+
},
141+
process,
142+
};
143+
},
132144
minify: {
133145
collapseWhitespace: true,
134146
removeAttributeQuotes: true,

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

+12
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ let webConfig = {
101101
new HtmlWebpackPlugin({
102102
filename: 'index.html',
103103
template: path.resolve(__dirname, '../src/index.ejs'),
104+
templateParameters(compilation, assets, options) {
105+
return {
106+
compilation: compilation,
107+
webpack: compilation.getStats().toJson(),
108+
webpackConfig: compilation.options,
109+
htmlWebpackPlugin: {
110+
files: assets,
111+
options: options,
112+
},
113+
process,
114+
};
115+
},
104116
minify: {
105117
collapseWhitespace: true,
106118
removeAttributeQuotes: true,

0 commit comments

Comments
 (0)