Skip to content

Commit

Permalink
fix: ssr manifest 正确读取环境变量
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed May 7, 2024
1 parent a82a386 commit c2b9448
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/bundler-webpack/src/config/definePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export function resolveDefine(opts: { define: any; publicPath?: string }) {
env.PUBLIC_PATH = opts.publicPath || '/';

for (const key in env) {
env[key] = JSON.stringify(env[key]);
env[`process.env.${key}`] = JSON.stringify(env[key]);
delete env[key];
}

const define: Record<string, any> = {};
Expand All @@ -36,7 +37,7 @@ export function resolveDefine(opts: { define: any; publicPath?: string }) {
}

return {
'process.env': env,
...env,
...define,
};
}
Expand Down

0 comments on commit c2b9448

Please sign in to comment.