Skip to content

Commit

Permalink
fix(ruleset-bundler): do not evalute builtin modules as external
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyexi committed May 11, 2022
1 parent e6a90f2 commit 7e1c787
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ruleset-bundler/src/index.ts
Expand Up @@ -36,7 +36,10 @@ export async function bundleRuleset(
: target === 'browser'
? id => isURL(id)
: (id, importer) =>
id.startsWith('node:') || (!isURL(id) && isPackageImport(id) && (importer === void 0 || !isURL(importer))),
id.startsWith('node:') ||
(!isURL(id) &&
isPackageImport(id) &&
(importer === void 0 || !isURL(importer) || id.startsWith('@stoplight/spectral-'))),
});

return (await bundle.generate({ format: format ?? (target === 'runtime' ? 'iife' : 'esm'), exports: 'auto' }))
Expand Down

0 comments on commit 7e1c787

Please sign in to comment.