@vizejs/vite-plugin 0.139.0 → 0.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @vizejs/vite-plugin
2
2
 
3
- High-performance native Vite plugin for Vue SFC compilation powered by [Vize](https://github.com/ubugeeei/vize).
3
+ High-performance native Vite plugin for Vue SFC compilation powered by [Vize](https://github.com/ubugeeei-prod/vize).
4
4
 
5
5
  ## Features
6
6
 
@@ -18,7 +18,7 @@ Install `vp` once from the [Vite+ install guide](https://viteplus.dev/guide/inst
18
18
  vp install -D @vizejs/vite-plugin
19
19
  ```
20
20
 
21
- Add `vize` as a direct dependency only if your project imports shared config helpers from `"vize"` (see [Shared Config](https://github.com/ubugeeei/vize/blob/main/docs/content/guide/vite-plugin.md#shared-config)).
21
+ Add `vize` as a direct dependency only if your project imports shared config helpers from `"vize"` (see [Shared Config](https://github.com/ubugeeei-prod/vize/blob/main/docs/content/guide/vite-plugin.md#shared-config)).
22
22
 
23
23
  ## Usage
24
24
 
package/dist/index.mjs CHANGED
@@ -562,6 +562,19 @@ function isOptimizedVueDependency(id) {
562
562
  const { request } = splitViteIdQuery(id);
563
563
  return request.split(path.sep).join("/").includes("/node_modules/.vite/deps/vue.");
564
564
  }
565
+ const vueResolvableFromRootCache = /* @__PURE__ */ new Map();
566
+ function isVueResolvableFromRoot(root) {
567
+ let cached = vueResolvableFromRootCache.get(root);
568
+ if (cached === void 0) {
569
+ cached = false;
570
+ try {
571
+ createRequire(path.join(root, "__vize_probe__.js")).resolve("vue");
572
+ cached = true;
573
+ } catch {}
574
+ vueResolvableFromRootCache.set(root, cached);
575
+ }
576
+ return cached;
577
+ }
565
578
  function normalizeResolvedVuePath(id) {
566
579
  return normalizeViteResolvedVuePath(id);
567
580
  }
@@ -699,8 +712,13 @@ async function resolveIdHook(ctx, state, id, importer, options) {
699
712
  id: normalizedFsId
700
713
  };
701
714
  if (isVueRuntime && state.server !== null && !isOptimizedVueDependency(resolved.id)) {
702
- state.logger.log(`resolveId: deferring Vue runtime ${resolved.id} to Vite optimizer`);
703
- return null;
715
+ if (isVueResolvableFromRoot(state.root)) {
716
+ state.logger.log(`resolveId: deferring Vue runtime ${resolved.id} to Vite optimizer`);
717
+ return null;
718
+ }
719
+ const isolatedEntry = resolveVueBundlerEntryWithNode(state, id, cleanImporter) ?? resolved.id;
720
+ state.logger.log(`resolveId: isolated install — resolved Vue runtime to ${isolatedEntry}`);
721
+ return isolatedEntry;
704
722
  }
705
723
  if (isVueRuntime && isVuePackageEntry(resolved.id)) {
706
724
  const vueBundlerEntry = resolveVueBundlerEntryWithNode(state, id, cleanImporter);
@@ -712,7 +730,7 @@ async function resolveIdHook(ctx, state, id, importer, options) {
712
730
  }
713
731
  if (isViteBareSpecifier(resolved.id)) {
714
732
  if (isVueRuntime) {
715
- const vueBundlerEntry = isBuild ? resolveVueBundlerEntryWithNode(state, id, cleanImporter) : null;
733
+ const vueBundlerEntry = isBuild || !isVueResolvableFromRoot(state.root) ? resolveVueBundlerEntryWithNode(state, id, cleanImporter) : null;
716
734
  if (vueBundlerEntry) {
717
735
  state.logger.log(`resolveId: resolved Vue runtime to ${vueBundlerEntry}`);
718
736
  return vueBundlerEntry;
@@ -731,7 +749,7 @@ async function resolveIdHook(ctx, state, id, importer, options) {
731
749
  }
732
750
  } catch {}
733
751
  if (isVueRuntime) {
734
- const vueBundlerEntry = isBuild ? resolveVueBundlerEntryWithNode(state, id, cleanImporter) : null;
752
+ const vueBundlerEntry = isBuild || !isVueResolvableFromRoot(state.root) ? resolveVueBundlerEntryWithNode(state, id, cleanImporter) : null;
735
753
  if (vueBundlerEntry) {
736
754
  state.logger.log(`resolveId: resolved Vue runtime to ${vueBundlerEntry}`);
737
755
  return vueBundlerEntry;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.139.0",
3
+ "version": "0.142.0",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "keywords": [
6
6
  "compiler",
@@ -11,14 +11,14 @@
11
11
  "vite",
12
12
  "vue"
13
13
  ],
14
- "homepage": "https://github.com/ubugeeei/vize",
14
+ "homepage": "https://github.com/ubugeeei-prod/vize",
15
15
  "bugs": {
16
- "url": "https://github.com/ubugeeei/vize/issues"
16
+ "url": "https://github.com/ubugeeei-prod/vize/issues"
17
17
  },
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "https://github.com/ubugeeei/vize",
21
+ "url": "https://github.com/ubugeeei-prod/vize",
22
22
  "directory": "npm/vite-plugin-vize"
23
23
  },
24
24
  "files": [
@@ -39,9 +39,9 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@vizejs/native": "0.139.0",
42
+ "@vizejs/native": "0.142.0",
43
43
  "tinyglobby": "0.2.16",
44
- "vize": "0.139.0"
44
+ "vize": "0.142.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node": "25.7.0",