@vizejs/vite-plugin 0.643.0 → 0.644.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/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as vize } from "./plugin-O_hBKlyV.mjs";
1
+ import { t as vize } from "./plugin-0HswQ2qL.mjs";
2
2
  import { u as rewriteStaticAssetUrls } from "./vue-version-BFh0eI6J.mjs";
3
3
  import { a as resolveViteConfigExport, i as resolveConfigExport, n as defineConfig, o as vizeConfigStore, r as loadConfig, t as VIZE_CONFIG_FILE_ENV } from "./config-LlMZcDZI.mjs";
4
4
  //#region src/index.ts
@@ -1799,6 +1799,10 @@ function compileScopedBatch(files, state) {
1799
1799
  * batch-compiles the rest. Extracted from `state.ts` so the state module stays
1800
1800
  * a state module.
1801
1801
  */
1802
+ /** Known SFC diagnostics from speculative startup compilation, without I/O failures. */
1803
+ var PrecompileDiagnosticsError = class extends Error {
1804
+ name = "PrecompileDiagnosticsError";
1805
+ };
1802
1806
  /**
1803
1807
  * The options the pre-compile batch actually compiles with.
1804
1808
  *
@@ -1866,6 +1870,7 @@ async function compileAll(state, owners = []) {
1866
1870
  let successCount = 0;
1867
1871
  let restoredCount = 0;
1868
1872
  let failedCount = 0;
1873
+ let hasReadFailure = false;
1869
1874
  let nativeTimeMs = 0;
1870
1875
  const precompileFailures = [];
1871
1876
  const chunks = chunkPrecompileFiles(changedFiles, state.precompileBatchSize, { metadata: currentMetadata });
@@ -1878,8 +1883,10 @@ async function compileAll(state, owners = []) {
1878
1883
  source = fs.readFileSync(file, "utf-8");
1879
1884
  } catch (e) {
1880
1885
  failedCount++;
1886
+ hasReadFailure = true;
1881
1887
  state.cache.delete(file);
1882
- if (state.extractCss) state.collectedCss.delete(file);
1888
+ state.ssrCache.delete(file);
1889
+ state.collectedCss.delete(file);
1883
1890
  state.precompileMetadata.delete(file);
1884
1891
  cache.delete(file);
1885
1892
  precompileFailures.push(`[vize] Failed to read ${file}: ${formatUnknownError$2(e)}`);
@@ -1923,7 +1930,8 @@ async function compileAll(state, owners = []) {
1923
1930
  const metadata = currentMetadata.get(fileResult.path);
1924
1931
  if (fileResult.errors.length > 0) {
1925
1932
  state.cache.delete(fileResult.path);
1926
- if (state.extractCss) state.collectedCss.delete(fileResult.path);
1933
+ state.ssrCache.delete(fileResult.path);
1934
+ state.collectedCss.delete(fileResult.path);
1927
1935
  state.precompileMetadata.delete(fileResult.path);
1928
1936
  cache.delete(fileResult.path);
1929
1937
  precompileFailures.push(formatCompileErrorMessage(fileResult.path, fileResult.errors));
@@ -1947,7 +1955,9 @@ async function compileAll(state, owners = []) {
1947
1955
  state.logger.info(`Pre-compilation complete: ${successCount} recompiled, ${restoredCount} restored from disk, ${cachedFileCount} reused, ${failedCount} failed (${elapsed}ms, native ${batchLabel}: ${nativeTimeMs.toFixed(2)}ms)`);
1948
1956
  if (failedCount > 0) {
1949
1957
  const details = precompileFailures.length > 0 ? `\n\n${precompileFailures.join("\n\n")}` : "";
1950
- throw new Error(`[vize] Pre-compilation failed for ${failedCount} file(s).${details}`);
1958
+ const message = `[vize] Pre-compilation failed for ${failedCount} file(s).${details}`;
1959
+ if (hasReadFailure) throw new Error(message);
1960
+ throw new PrecompileDiagnosticsError(message);
1951
1961
  }
1952
1962
  }
1953
1963
  function formatUnknownError$2(error) {
@@ -4239,9 +4249,9 @@ function mergeCompilerOptions(options, sharedConfig, defaults = {}) {
4239
4249
  runtimeGlobalName: options.runtimeGlobalName ?? compilerConfig.runtimeGlobalName ?? "Vue",
4240
4250
  include: options.include ?? viteConfig.include,
4241
4251
  exclude: options.exclude ?? viteConfig.exclude,
4242
- scanPatterns: options.scanPatterns ?? viteConfig.scanPatterns,
4252
+ scanPatterns: options.scanPatterns ?? viteConfig.scanPatterns ?? sharedConfig?.files,
4243
4253
  precompileBatchSize: options.precompileBatchSize ?? viteConfig.precompileBatchSize,
4244
- ignorePatterns: options.ignorePatterns ?? viteConfig.ignorePatterns
4254
+ ignorePatterns: options.ignorePatterns ?? viteConfig.ignorePatterns ?? sharedConfig?.ignores
4245
4255
  };
4246
4256
  }
4247
4257
  //#endregion
@@ -4629,10 +4639,15 @@ function vize(options = {}, compilerDefaults = {}, hostContext) {
4629
4639
  async buildStart() {
4630
4640
  state.viteResolveCache?.clear();
4631
4641
  if (!state.scanPatterns || state.scanPatterns.length === 0) return;
4632
- await compileAll({
4633
- ...state,
4634
- extractCss: shouldExtractCssForBuild(state, this)
4635
- }, precompileInputOwners(this, precompileConfig));
4642
+ try {
4643
+ await compileAll({
4644
+ ...state,
4645
+ extractCss: shouldExtractCssForBuild(state, this)
4646
+ }, precompileInputOwners(this, precompileConfig));
4647
+ } catch (error) {
4648
+ if (!(error instanceof PrecompileDiagnosticsError)) throw error;
4649
+ state.logger.warn(`${error.message}\nStartup scan diagnostics are deferred until import.`);
4650
+ }
4636
4651
  state.logger.log("Cache keys:", [...state.cache.keys()].slice(0, 3));
4637
4652
  },
4638
4653
  resolveId(id, importer, options) {
@@ -0,0 +1,2 @@
1
+ import { t as vize } from "./plugin-0HswQ2qL.mjs";
2
+ export { vize };
@@ -400,7 +400,7 @@ function defineConfig(config = {}, integration = {}) {
400
400
  const legacy = compiler !== false && (await import("./vue-version-DOjZaMiI.mjs")).isLegacyVueCompatibilityMode(compiler);
401
401
  const plugins = compiler === false || legacy ? [...vp.plugins ?? []] : await withoutVueCompiler(vp.plugins ?? []);
402
402
  if (compiler !== false) {
403
- const { vize } = await import("./plugin-B5Myk0El.mjs");
403
+ const { vize } = await import("./plugin-sV6VpY9P.mjs");
404
404
  plugins.push(vize({
405
405
  ...plugin,
406
406
  configMode: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/vite-plugin",
3
- "version": "0.643.0",
3
+ "version": "0.644.0",
4
4
  "description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
5
5
  "keywords": [
6
6
  "compiler",
@@ -51,13 +51,13 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@vizejs/native": "0.643.0",
55
- "@vizejs/unplugin": "0.643.0",
54
+ "@vizejs/native": "0.644.0",
55
+ "@vizejs/unplugin": "0.644.0",
56
56
  "jsonc-parser": "^3.3.1",
57
57
  "oxc-parser": "0.144.0",
58
58
  "picomatch": "4.0.5",
59
59
  "tinyglobby": "0.2.17",
60
- "vize": "0.643.0"
60
+ "vize": "0.644.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "25.9.2",
@@ -1,2 +0,0 @@
1
- import { t as vize } from "./plugin-O_hBKlyV.mjs";
2
- export { vize };