Skip to content

Commit

Permalink
fix: 环境变量读取错误
Browse files Browse the repository at this point in the history
  • Loading branch information
lzxb committed Nov 30, 2024
1 parent 7f4018e commit 2ce7bb5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/rspack/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,19 @@ function rewriteBuild(gez: Gez, options: RspackAppOptions = {}) {
gez.writeSync(
gez.resolvePath('dist/index.js'),
`
import { Gez } from '@gez/core';
process.env.NODE_ENV = process.env.NODE_ENV ?? 'production';
const options = await import('./node/src/entry.node.js').then(m => m.default);
const gez = new Gez(options);
async function start() {
const options = await import('./node/src/entry.node.js').then(
(mod) => mod.default
);
const { Gez } = await import('@gez/core');
const gez = new Gez(options);
await gez.init(gez.COMMAND.start);
}
await gez.init(gez.COMMAND.start);
start();
`.trim()
);
return pack(gez);
Expand Down

0 comments on commit 2ce7bb5

Please sign in to comment.