Skip to content

Commit

Permalink
Don't sanitize virtual:* imports (resolves #370)
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Nov 30, 2023
1 parent 09f7a58 commit 9697689
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/knip/src/util/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@ export const getEntryPathFromManifest = (
export const sanitizeSpecifier = (specifier: string) => {
if (isBuiltin(specifier)) return specifier;
if (isAbsolute(specifier)) return specifier;
if (specifier.startsWith('virtual:')) return specifier;
return specifier.replace(/^([?!|-]+)?([^!?:]+).*/, '$2');
};

0 comments on commit 9697689

Please sign in to comment.