diff --git a/src/build.ts b/src/build.ts index b1b88718f..52fdc7697 100644 --- a/src/build.ts +++ b/src/build.ts @@ -238,6 +238,11 @@ export async function build( const r = resolvers.resolveImport(specifier); const a = aliases.get(resolvePath(path, r)); return a ? relativePath(path, a) : isPathImport(specifier) ? specifier : r; // fallback to specifier if enoent + }, + resolveScript(specifier) { + const r = resolvers.resolveScript(specifier); + const a = aliases.get(resolvePath(path, r)); + return a ? relativePath(path, a) : specifier; // fallback to specifier if enoent } } }); diff --git a/test/output/build/imports/script.html b/test/output/build/imports/script.html index 510ccd227..cfd0511db 100644 --- a/test/output/build/imports/script.html +++ b/test/output/build/imports/script.html @@ -36,7 +36,7 @@

Scripts

- +