fix: add env to EmitPlugin config

This commit is contained in:
KernelDeimos 2024-08-29 21:52:29 -04:00 committed by Eric Dubé
parent 72946f920c
commit 4b8910169a
2 changed files with 5 additions and 2 deletions

View File

@ -130,7 +130,10 @@ async function build(options){
main_array.push(path.join(__dirname, 'src', js_paths[i]));
}
webpack({
...BaseConfig(options),
...BaseConfig({
...options,
env: 'prod',
}),
mode: 'production',
optimization: {
minimize: true,

View File

@ -6,7 +6,7 @@ module.exports = ({ dir, options }) => function () {
const compiler = this;
compiler.hooks.emit.tapAsync('EmitPlugin', async (compilation, callback) => {
let prefix_text = '';
prefix_text += 'window.gui_env="dev";\n';
prefix_text += `window.gui_env="${options.env}";\n`;
// -----------------------------------------------
// Combine all images into a single js file