Skip to content

Commit 4b89101

Browse files
committed
fix: add env to EmitPlugin config
1 parent 72946f9 commit 4b89101

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/gui/utils.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ async function build(options){
130130
main_array.push(path.join(__dirname, 'src', js_paths[i]));
131131
}
132132
webpack({
133-
...BaseConfig(options),
133+
...BaseConfig({
134+
...options,
135+
env: 'prod',
136+
}),
134137
mode: 'production',
135138
optimization: {
136139
minimize: true,

src/gui/webpack/EmitPlugin.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = ({ dir, options }) => function () {
66
const compiler = this;
77
compiler.hooks.emit.tapAsync('EmitPlugin', async (compilation, callback) => {
88
let prefix_text = '';
9-
prefix_text += 'window.gui_env="dev";\n';
9+
prefix_text += `window.gui_env="${options.env}";\n`;
1010

1111
// -----------------------------------------------
1212
// Combine all images into a single js file

0 commit comments

Comments
 (0)