diff options
Diffstat (limited to 'scripts/cmd/prebuild.js')
-rw-r--r-- | scripts/cmd/prebuild.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/cmd/prebuild.js b/scripts/cmd/prebuild.js index 1c62e8135..68a3a4f91 100644 --- a/scripts/cmd/prebuild.js +++ b/scripts/cmd/prebuild.js @@ -99,17 +99,19 @@ export default async function prebuild(...args) { const code = result.build.outputFiles[0].text.trim(); const rootURL = new URL('../../', import.meta.url); const rel = path.relative(fileURLToPath(rootURL), filepath); + const generatedCode = escapeTemplateLiterals(code); const mod = `/** * This file is prebuilt from ${rel} * Do not edit this directly, but instead edit that file and rerun the prebuild * to generate this file. */ -export default \`${escapeTemplateLiterals(code)}\`;`; +export default \`${generatedCode}\`;`; const url = getPrebuildURL(filepath, result.dev); await fs.promises.writeFile(url, mod, 'utf-8'); } } - - await Promise.all(entryPoints.map(prebuildFile)); + for (const entrypoint of entryPoints) { + await prebuildFile(entrypoint); + } } |