fix(nitro): inject entryURL at beginning of entrypoint (#468)

This commit is contained in:
Daniel Roe 2021-09-03 13:27:19 +01:00 committed by GitHub
parent 7f9ef5e13d
commit 7527d30bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,7 +54,7 @@ export function dirnames (): Plugin {
name: 'dirnames',
renderChunk (code, chunk) {
return {
code: code + (chunk.isEntry ? 'globalThis.entryURL = import.meta.url' : ''),
code: (chunk.isEntry ? 'globalThis.entryURL = import.meta.url;' : '') + code,
map: null
}
}