Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: 修正环境变量替换导致的语法错误
Browse files Browse the repository at this point in the history
之前写法会 `process.env` 替换成 `{"NODE_ENV":"development","REMAX_PLATFORM":"alipay"}` 导致语法错误
  • Loading branch information
yesmeck committed Sep 23, 2019
1 parent ee79d99 commit 5a5c020
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/remax-cli/src/build/rollupConfig.ts
Expand Up @@ -162,9 +162,10 @@ export default function rollupConfig(
}),
json({}),
replace({
values: {
'process.env': JSON.stringify(envReplacement),
},
values: Object.keys(envReplacement).reduce((acc: any, key) => {
acc[`process.env.${key}`] = JSON.stringify(envReplacement[key]);
return acc;
}, {}),
}),
resolve({
dedupe: [
Expand Down

0 comments on commit 5a5c020

Please sign in to comment.