mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
fix: add env to EmitPlugin config
This commit is contained in:
parent
72946f920c
commit
4b8910169a
@ -130,7 +130,10 @@ async function build(options){
|
|||||||
main_array.push(path.join(__dirname, 'src', js_paths[i]));
|
main_array.push(path.join(__dirname, 'src', js_paths[i]));
|
||||||
}
|
}
|
||||||
webpack({
|
webpack({
|
||||||
...BaseConfig(options),
|
...BaseConfig({
|
||||||
|
...options,
|
||||||
|
env: 'prod',
|
||||||
|
}),
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: true,
|
minimize: true,
|
||||||
|
@ -6,7 +6,7 @@ module.exports = ({ dir, options }) => function () {
|
|||||||
const compiler = this;
|
const compiler = this;
|
||||||
compiler.hooks.emit.tapAsync('EmitPlugin', async (compilation, callback) => {
|
compiler.hooks.emit.tapAsync('EmitPlugin', async (compilation, callback) => {
|
||||||
let prefix_text = '';
|
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
|
// Combine all images into a single js file
|
||||||
|
Loading…
Reference in New Issue
Block a user