Skip to content

Commit

Permalink
fix(config): load native esm ts config string with base64 encoding
Browse files Browse the repository at this point in the history
fix #1548
  • Loading branch information
yyx990803 committed Jan 15, 2021
1 parent d8754de commit 55b05db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/node/config.ts
Expand Up @@ -415,7 +415,11 @@ export async function loadConfigFromFile(
const code = await bundleConfigFile(resolvedPath, 'es')
userConfig = (
await eval(
`import(${JSON.stringify(`data:text/javascript,${code}`)})`
`import(${JSON.stringify(
`data:text/javascript;base64,${Buffer.from(code).toString(
'base64'
)}`
)})`
)
).default
debug(`TS + native esm config loaded in ${Date.now() - start}ms`)
Expand Down

0 comments on commit 55b05db

Please sign in to comment.