Skip to content

Commit

Permalink
Merge pull request #23 from Lazy-work/unplugin/filter_symbolic_links
Browse files Browse the repository at this point in the history
fix(unplugin): filter symbolic links
  • Loading branch information
abdullah-wn authored Jan 23, 2025
2 parents b772abf + 7267774 commit 8e14d53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thirty-weeks-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'unplugin-unisonjs': patch
---

Filter symbolic links
3 changes: 2 additions & 1 deletion packages/unplugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (
return null;
},
async transform(code, id) {
if (id.includes("/node_modules/")) return;
if (id.includes("/node_modules/") || !id.includes(process.cwd())) return;

const [filepath] = id.split("?");
if (!filter(filepath)) return;
Expand All @@ -137,6 +137,7 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (
skipEnvCheck: true,
signals: opts?.signals,
module: opts?.module,
mode: opts?.compiler?.mode || 'full'
},
]);
}
Expand Down

0 comments on commit 8e14d53

Please sign in to comment.