Skip to content

Commit

Permalink
chore: 新增 ssr 黑盒变量 SSR_RESOURCE_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinbao1001 committed May 7, 2024
1 parent c2b9448 commit 1088ee4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/bundler-webpack/src/config/definePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export function resolveDefine(opts: { define: any; publicPath?: string }) {
env.PUBLIC_PATH = opts.publicPath || '/';

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

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

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

0 comments on commit 1088ee4

Please sign in to comment.