Skip to content

Commit

Permalink
fix(optimizer): ensure consistency with replace define (#2929)
Browse files Browse the repository at this point in the history
fix #2893
  • Loading branch information
underfin committed Apr 17, 2021
1 parent 59871ef commit ddb7a91
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ export async function optimizeDeps(
'process.env.NODE_ENV': JSON.stringify(config.mode)
}
for (const key in config.define) {
define[key] = JSON.stringify(config.define[key])
const value = config.define[key]
define[key] = typeof value === 'string' ? value : JSON.stringify(value)
}

const start = Date.now()
Expand Down

0 comments on commit ddb7a91

Please sign in to comment.