@vizejs/vite-plugin 0.0.1-alpha.71 → 0.0.1-alpha.73

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -348,6 +348,14 @@ function vize(options = {}) {
348
348
  logger.log("Cache keys:", [...cache.keys()].slice(0, 3));
349
349
  },
350
350
  async resolveId(id, importer) {
351
+ if (id.startsWith("\0")) return null;
352
+ if (id.startsWith("vize:")) {
353
+ let realPath = id.slice(5);
354
+ if (realPath.endsWith(".ts")) realPath = realPath.slice(0, -3);
355
+ logger.log(`resolveId: redirecting stale vize: ID to ${realPath}`);
356
+ if (realPath.includes("node_modules")) return realPath;
357
+ return this.resolve(realPath, importer, { skipSelf: true });
358
+ }
351
359
  if (id === VIRTUAL_CSS_MODULE) return RESOLVED_CSS_MODULE;
352
360
  if (id.includes("?vue&type=style")) return id;
353
361
  if (importer?.startsWith(VIRTUAL_PREFIX)) {
@@ -382,7 +390,19 @@ function vize(options = {}) {
382
390
  }
383
391
  }
384
392
  if (id.endsWith(".vue")) {
393
+ if (id.includes("node_modules")) {
394
+ logger.log(`resolveId: skipping node_modules import ${id}`);
395
+ return null;
396
+ }
385
397
  const resolved = resolveVuePath(id, importer);
398
+ if (resolved.includes("node_modules")) {
399
+ logger.log(`resolveId: skipping node_modules path ${resolved}`);
400
+ return null;
401
+ }
402
+ if (!filter(resolved)) {
403
+ logger.log(`resolveId: skipping filtered path ${resolved}`);
404
+ return null;
405
+ }
386
406
  const hasCache = cache.has(resolved);
387
407
  const fileExists = fs.existsSync(resolved);
388
408
  logger.log(`resolveId: id=${id}, resolved=${resolved}, hasCache=${hasCache}, fileExists=${fileExists}, importer=${importer ?? "none"}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.0.1-alpha.71",
3
+ "version": "0.0.1-alpha.73",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "publishConfig": {
6
6
  "provenance": true,
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "tinyglobby": "^0.2.0",
47
- "@vizejs/native": "0.0.1-alpha.71"
47
+ "@vizejs/native": "0.0.1-alpha.73"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsdown",