Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeck committed Sep 16, 2021
1 parent 257ac6f commit 8eb74ef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/fixtures/es-module-loaders/mock-loader.mjs
Expand Up @@ -78,7 +78,9 @@ export function globalPreload({port}) {
// rewrites node: loading to node-custom: so that it can be intercepted
export function resolve(specifier, context, defaultResolve) {
if (specifier === 'node:mock') {
return {url: specifier};
return {
url: specifier
};
}
doDrainPort();
const def = defaultResolve(specifier, context);
Expand All @@ -97,7 +99,10 @@ export function resolve(specifier, context, defaultResolve) {
export function load(url, context, defaultLoad) {
doDrainPort();
if (url === 'node:mock') {
return {source: 'export default import.meta.doMock'};
return {
source: 'export default import.meta.doMock',
format: 'module'
};
}
if (url.startsWith('mock:')) {
let [proto, version, encodedTargetURL] = url.split(':');
Expand Down

0 comments on commit 8eb74ef

Please sign in to comment.