Skip to content

Commit

Permalink
(fix): Improve the check for vite/ imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JayaKrishnaNamburu committed Aug 7, 2023
1 parent 5218d23 commit 4b5f7bb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"@vue/compiler-dom": "^3.2.31"
},
"dependencies": {
"@jspm/generator": "^1.1.1"
"@jspm/generator": "^1.1.9"
},
"peerDependencies": {
"vite": "*"
},
"engines": {
"node": ">=14.0.0"
"node": ">=18"
}
}
8 changes: 4 additions & 4 deletions plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ async function plugin(pluginOptions?: PluginOptions): Promise<Plugin[]> {
if (
id.startsWith("/") ||
id.startsWith(".") ||
id.startsWith("vite/") ||
id.startsWith("__vite") ||
id.includes("vite/") ||
id.includes("__vite") ||
id.includes(".css") ||
id.includes(".html") ||
path.isAbsolute(id) ||
Expand Down Expand Up @@ -127,7 +127,7 @@ async function plugin(pluginOptions?: PluginOptions): Promise<Plugin[]> {
return null;
}

if (id.startsWith("vite/") || path.isAbsolute(id)) {
if (id.includes("vite/") || path.isAbsolute(id)) {
return;
}

Expand Down Expand Up @@ -163,7 +163,7 @@ async function plugin(pluginOptions?: PluginOptions): Promise<Plugin[]> {
return { id, external: true };
},
async load(id) {
if (id?.startsWith("vite/") || !id?.startsWith("http")) {
if (id?.includes("vite/") || !id?.includes("http")) {
return;
}

Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4b5f7bb

Please sign in to comment.