Skip to content

Commit

Permalink
Revert "fix: timestamp config dynamicImport (#13502)"
Browse files Browse the repository at this point in the history
This reverts commit 6a87c65.
  • Loading branch information
patak-dev committed Jul 6, 2023
1 parent 3f4e36e commit bd544ab
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1153,16 +1153,10 @@ async function loadConfigFromBundledFile(
// convert to base64, load it with native Node ESM.
if (isESM) {
try {
// Postfix the bundled code with a timestamp to avoid Node's ESM loader cache
const configTimestamp = `${fileName}.timestamp:${Date.now()}-${Math.random()
.toString(16)
.slice(2)}`
return (
await dynamicImport(
'data:text/javascript;base64,' +
Buffer.from(`${bundledCode}\n//${configTimestamp}`).toString(
'base64',
),
Buffer.from(bundledCode).toString('base64'),
)
).default
} catch (e) {
Expand Down

0 comments on commit bd544ab

Please sign in to comment.