diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fec0e23..d3578d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: timeout-minutes: 3 strategy: matrix: - nodejs: [12, 14, 16.11, 16] + nodejs: [12, 14, 16.11, 16, 18] os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 diff --git a/package.json b/package.json index b723c3f..87f5bdb 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "scripts": { "build": "node build", - "types": "tsc" + "types": "tsc --skipLibCheck" }, "dependencies": { "esbuild": "^0.14.0" diff --git a/src/loader.ts b/src/loader.ts index 6f0b195..12e0cc4 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -81,11 +81,11 @@ export const resolve: Resolve = async function (ident, context, fallback) { if (match = EXTN.exec(output.href)) { ext = match[0] as Extension; if (!context.parentURL || isTS.test(ext)) { - return { url: output.href }; + return { url: output.href, shortCircuit: true }; } // source ident exists path = check(output.href); - if (path) return { url: path }; + if (path) return { url: path, shortCircuit: true }; // parent importer is a ts file // source ident is js & NOT exists if (isJS.test(ext) && isTS.test(context.parentURL)) { @@ -96,7 +96,7 @@ export const resolve: Resolve = async function (ident, context, fallback) { if (idx > output.href.length) { path += output.href.substring(idx); } - return { url: path }; + return { url: path, shortCircuit: true }; } // return original, let it error return fallback(ident, context, fallback); @@ -107,7 +107,7 @@ export const resolve: Resolve = async function (ident, context, fallback) { for (ext in config) { path = check(output.href + ext); - if (path) return { url: path }; + if (path) return { url: path, shortCircuit: true }; } return fallback(ident, context, fallback); @@ -131,7 +131,7 @@ export const load: Load = async function (uri, context, fallback) { format: format === 'module' ? 'esm' : 'cjs', }); - return { format, source: result.code }; + return { format, source: result.code, shortCircuit: true }; } /** @deprecated */