@voidzero-dev/vite-plus-core 0.1.16-alpha.4 → 0.1.17-alpha.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.
@@ -2,7 +2,7 @@ import { r as __toESM, t as __commonJSMin } from "./chunk-CSNpwdVU.js";
2
2
  import { C as promiseWithResolvers, D as toArray, E as slash, S as pkgExists, T as resolveRegex, _ as yellow, a as createLogger, b as matchPattern, c as globalLogger, d as bold, f as dim, g as underline, h as red, i as LogLevels, l as prettyFormat, n as z, o as generateColor, p as green, r as version, s as getNameLabel, t as R, u as blue, v as debounce, w as resolveComma, x as noop, y as importWithError } from "./main-wrcIC7dd.js";
3
3
  import { t as createDebug } from "./node-B3Gdtau1.js";
4
4
  import { d as filename_js_to_dts, i as RE_JS, n as RE_DTS, o as RE_NODE_MODULES$1, t as RE_CSS } from "./filename-DQnUJlio-D58wGDtS.js";
5
- import "./dist-CxeZzY9B.js";
5
+ import "./dist-D7qIxBaV.js";
6
6
  import module$1, { builtinModules, createRequire, isBuiltin } from "node:module";
7
7
  import process$1, { env } from "node:process";
8
8
  import readline from "node:readline";
@@ -11,7 +11,7 @@ import path, { dirname, isAbsolute, join, parse, resolve } from "node:path";
11
11
  import { VERSION, build, watch } from "@voidzero-dev/vite-plus-core/rolldown";
12
12
  import { access, chmod, cp, mkdir, mkdtemp, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
13
13
  import { and, id, importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filter";
14
- import re, { existsSync, readFileSync, writeFileSync } from "node:fs";
14
+ import fs$1, { existsSync, readFileSync, writeFileSync } from "node:fs";
15
15
  import * as nativeFs$1 from "fs";
16
16
  import nativeFs from "fs";
17
17
  import path$1, { basename, dirname as dirname$1, normalize as normalize$1, posix, relative, resolve as resolve$1, sep } from "path";
@@ -3182,87 +3182,87 @@ quansync$1({
3182
3182
  */
3183
3183
  const quansync = quansync$1;
3184
3184
  quansync$1({
3185
- sync: re.readFileSync,
3186
- async: re.promises.readFile
3185
+ sync: fs$1.readFileSync,
3186
+ async: fs$1.promises.readFile
3187
3187
  });
3188
3188
  quansync$1({
3189
- sync: re.writeFileSync,
3190
- async: re.promises.writeFile
3189
+ sync: fs$1.writeFileSync,
3190
+ async: fs$1.promises.writeFile
3191
3191
  });
3192
3192
  quansync$1({
3193
- sync: re.unlinkSync,
3194
- async: re.promises.unlink
3193
+ sync: fs$1.unlinkSync,
3194
+ async: fs$1.promises.unlink
3195
3195
  });
3196
3196
  quansync$1({
3197
- sync: re.accessSync,
3198
- async: re.promises.access
3197
+ sync: fs$1.accessSync,
3198
+ async: fs$1.promises.access
3199
3199
  });
3200
3200
  /**
3201
3201
  * @link https://nodejs.org/api/fs.html#fspromisesstatpath-options
3202
3202
  */
3203
3203
  const stat$1 = quansync$1({
3204
- sync: re.statSync,
3205
- async: re.promises.stat
3204
+ sync: fs$1.statSync,
3205
+ async: fs$1.promises.stat
3206
3206
  });
3207
3207
  const lstat = quansync$1({
3208
- sync: re.lstatSync,
3209
- async: re.promises.lstat
3208
+ sync: fs$1.lstatSync,
3209
+ async: fs$1.promises.lstat
3210
3210
  });
3211
3211
  quansync$1({
3212
- sync: re.copyFileSync,
3213
- async: re.promises.copyFile
3212
+ sync: fs$1.copyFileSync,
3213
+ async: fs$1.promises.copyFile
3214
3214
  });
3215
3215
  quansync$1({
3216
- sync: re.rmSync,
3217
- async: re.promises.rm
3216
+ sync: fs$1.rmSync,
3217
+ async: fs$1.promises.rm
3218
3218
  });
3219
3219
  quansync$1({
3220
- sync: re.mkdirSync,
3221
- async: re.promises.mkdir
3220
+ sync: fs$1.mkdirSync,
3221
+ async: fs$1.promises.mkdir
3222
3222
  });
3223
3223
  quansync$1({
3224
- sync: re.renameSync,
3225
- async: re.promises.rename
3224
+ sync: fs$1.renameSync,
3225
+ async: fs$1.promises.rename
3226
3226
  });
3227
3227
  quansync$1({
3228
- sync: re.readdirSync,
3229
- async: re.promises.readdir
3228
+ sync: fs$1.readdirSync,
3229
+ async: fs$1.promises.readdir
3230
3230
  });
3231
3231
  quansync$1({
3232
- sync: re.realpathSync,
3233
- async: re.promises.realpath
3232
+ sync: fs$1.realpathSync,
3233
+ async: fs$1.promises.realpath
3234
3234
  });
3235
3235
  quansync$1({
3236
- sync: re.readlinkSync,
3237
- async: re.promises.readlink
3236
+ sync: fs$1.readlinkSync,
3237
+ async: fs$1.promises.readlink
3238
3238
  });
3239
3239
  quansync$1({
3240
- sync: re.symlinkSync,
3241
- async: re.promises.symlink
3240
+ sync: fs$1.symlinkSync,
3241
+ async: fs$1.promises.symlink
3242
3242
  });
3243
3243
  quansync$1({
3244
- sync: re.chownSync,
3245
- async: re.promises.chown
3244
+ sync: fs$1.chownSync,
3245
+ async: fs$1.promises.chown
3246
3246
  });
3247
3247
  quansync$1({
3248
- sync: re.lchownSync,
3249
- async: re.promises.lchown
3248
+ sync: fs$1.lchownSync,
3249
+ async: fs$1.promises.lchown
3250
3250
  });
3251
3251
  quansync$1({
3252
- sync: re.chmodSync,
3253
- async: re.promises.chmod
3252
+ sync: fs$1.chmodSync,
3253
+ async: fs$1.promises.chmod
3254
3254
  });
3255
3255
  quansync$1({
3256
- sync: re.utimesSync,
3257
- async: re.promises.utimes
3256
+ sync: fs$1.utimesSync,
3257
+ async: fs$1.promises.utimes
3258
3258
  });
3259
3259
  quansync$1({
3260
- sync: re.lutimesSync,
3261
- async: re.promises.lutimes
3260
+ sync: fs$1.lutimesSync,
3261
+ async: fs$1.promises.lutimes
3262
3262
  });
3263
3263
  quansync$1({
3264
- sync: re.mkdtempSync,
3265
- async: re.promises.mkdtemp
3264
+ sync: fs$1.mkdtempSync,
3265
+ async: fs$1.promises.mkdtemp
3266
3266
  });
3267
3267
  //#endregion
3268
3268
  //#region ../../node_modules/.pnpm/unconfig-core@7.5.0/node_modules/unconfig-core/dist/index.mjs
@@ -3964,7 +3964,7 @@ async function nativeImport(id) {
3964
3964
  return mod.default || mod;
3965
3965
  }
3966
3966
  async function unrunImport(id) {
3967
- const { unrun } = await import("./dist-Cqme3mtE.js");
3967
+ const { unrun } = await import("./dist-_IXstuie.js");
3968
3968
  const { module } = await unrun({ path: pathToFileURL(id).href });
3969
3969
  return module;
3970
3970
  }
@@ -4970,7 +4970,7 @@ async function resolveInputOptions(config, format, configFiles, bundle, cjsDts,
4970
4970
  if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
4971
4971
  if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepsPlugin(config, bundle));
4972
4972
  if (dts) {
4973
- const { dts: dtsPlugin } = await import("./dist-DpEByBn7.js");
4973
+ const { dts: dtsPlugin } = await import("./dist-CY3M22aR.js");
4974
4974
  const { cjsReexport: _, ...dtsPluginOptions } = dts;
4975
4975
  const options = {
4976
4976
  tsconfig,
@@ -0,0 +1,2 @@
1
+ import { r as build_exports } from "./build-DU-BFLB1-BZ80XpcX.js";
2
+ export { build_exports as r };
@@ -1,7 +1,7 @@
1
1
  import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./chunk-CSNpwdVU.js";
2
2
  import { t as createDebug } from "./node-B3Gdtau1.js";
3
3
  import { a as RE_JSON, c as RE_TS, d as filename_js_to_dts, f as filename_to_dts, i as RE_JS, l as RE_VUE, m as resolveTemplateFn, n as RE_DTS, o as RE_NODE_MODULES, p as replaceTemplateName, r as RE_DTS_MAP, s as RE_ROLLDOWN_RUNTIME, t as RE_CSS, u as filename_dts_to } from "./filename-DQnUJlio-D58wGDtS.js";
4
- import { n as pe, t as Ge } from "./dist-CxeZzY9B.js";
4
+ import { n as pe, t as Ge } from "./dist-D7qIxBaV.js";
5
5
  import { n as globalContext, r as invalidateContextFile, t as createContext } from "./tsc-context-Dban9z4Z.js";
6
6
  import { createRequire } from "node:module";
7
7
  import process from "node:process";
@@ -1,6 +1,6 @@
1
1
  import module from "node:module";
2
2
  import path from "node:path";
3
- import re from "node:fs";
3
+ import fs from "node:fs";
4
4
  import nativeFs from "fs";
5
5
  import Be from "os";
6
6
  import path$1 from "path";
@@ -63,11 +63,11 @@ function h(e) {
63
63
  }
64
64
  i(h, "slash");
65
65
  const Z = i((e) => {
66
- const t = re[e];
66
+ const t = fs[e];
67
67
  return (s, ...n) => {
68
68
  const o = `${e}:${n.join(":")}`;
69
69
  let l = s == null ? void 0 : s.get(o);
70
- return l === void 0 && (l = Reflect.apply(t, re, n), s?.set(o, l)), l;
70
+ return l === void 0 && (l = Reflect.apply(t, fs, n), s?.set(o, l)), l;
71
71
  };
72
72
  }, "cacheFs"), E = Z("existsSync"), $e = Z("readFileSync"), G = Z("statSync"), fe = i((e, t, s) => {
73
73
  for (;;) {
@@ -3,7 +3,7 @@ import process from "node:process";
3
3
  import "node:child_process";
4
4
  import path from "node:path";
5
5
  import { rolldown } from "@voidzero-dev/vite-plus-core/rolldown";
6
- import re, { existsSync } from "node:fs";
6
+ import fs, { existsSync } from "node:fs";
7
7
  import { tmpdir } from "node:os";
8
8
  import { fileURLToPath, pathToFileURL } from "node:url";
9
9
  import { Buffer } from "node:buffer";
@@ -54,7 +54,7 @@ function resolveOptions(options = {}) {
54
54
  inputOptions: options.inputOptions,
55
55
  outputOptions: options.outputOptions
56
56
  };
57
- if (!re.existsSync(resolvedOptions.path)) throw new Error(`[unrun] File not found: ${resolvedOptions.path}`);
57
+ if (!fs.existsSync(resolvedOptions.path)) throw new Error(`[unrun] File not found: ${resolvedOptions.path}`);
58
58
  if (!new Set([
59
59
  "none",
60
60
  "jiti",
@@ -268,7 +268,7 @@ function createJsonLoader() {
268
268
  let isRequire = false;
269
269
  try {
270
270
  if (importer) {
271
- const src = re.readFileSync(importer, "utf8");
271
+ const src = fs.readFileSync(importer, "utf8");
272
272
  const escaped = source.replaceAll(/[.*+?^${}()|[\]\\]/g, (m) => `\\${m}`);
273
273
  const pattern = String.raw`\brequire\s*\(\s*['"]${escaped}['"]\s*\)`;
274
274
  isRequire = new RegExp(pattern).test(src);
@@ -281,7 +281,7 @@ function createJsonLoader() {
281
281
  handler(id) {
282
282
  try {
283
283
  const realId = id.replace(/\?unrun-json\.(?:mjs|cjs)$/, "");
284
- const src = re.readFileSync(realId, "utf8");
284
+ const src = fs.readFileSync(realId, "utf8");
285
285
  const data = JSON.parse(src);
286
286
  const jsonLiteral = JSON.stringify(data);
287
287
  if (id.endsWith("?unrun-json.cjs")) return { code: `const __data = ${jsonLiteral}\ntry { Object.defineProperty(__data, 'default', { value: __data, enumerable: false, configurable: true }) } catch {}\nmodule.exports = __data\n` };
@@ -375,7 +375,7 @@ function createRequireResolveFix(options) {
375
375
  ".cjs"
376
376
  ]) {
377
377
  const testPath = path.resolve(baseDir, id + ext);
378
- if (re.existsSync(testPath)) return JSON.stringify(testPath);
378
+ if (fs.existsSync(testPath)) return JSON.stringify(testPath);
379
379
  }
380
380
  const resolvedPath = path.resolve(baseDir, id);
381
381
  return JSON.stringify(resolvedPath);
@@ -416,7 +416,7 @@ function createSourceContextShimsPlugin() {
416
416
  const normalizedPhysicalId = path.normalize(physicalId);
417
417
  let code;
418
418
  try {
419
- code = re.readFileSync(normalizedPhysicalId, "utf8");
419
+ code = fs.readFileSync(normalizedPhysicalId, "utf8");
420
420
  } catch {
421
421
  return null;
422
422
  }
@@ -658,7 +658,7 @@ function cleanModule(moduleUrl, options) {
658
658
  try {
659
659
  if (moduleUrl.startsWith("file://")) {
660
660
  const filePath = new URL(moduleUrl);
661
- re.unlinkSync(filePath);
661
+ fs.unlinkSync(filePath);
662
662
  }
663
663
  } catch (error) {
664
664
  if (error.code !== "ENOENT") throw error;
@@ -682,14 +682,14 @@ function writeModule(code, options) {
682
682
  const projectNodeModules = path.join(process.cwd(), "node_modules");
683
683
  const outDir = path.join(projectNodeModules, ".unrun");
684
684
  const outFile = path.join(outDir, fname);
685
- if (!re.existsSync(outFile)) try {
686
- re.mkdirSync(outDir, { recursive: true });
687
- re.writeFileSync(outFile, code, "utf8");
685
+ if (!fs.existsSync(outFile)) try {
686
+ fs.mkdirSync(outDir, { recursive: true });
687
+ fs.writeFileSync(outFile, code, "utf8");
688
688
  } catch {
689
689
  const fallbackDir = path.join(tmpdir(), "unrun-cache");
690
690
  const fallbackFile = path.join(fallbackDir, fname);
691
- re.mkdirSync(fallbackDir, { recursive: true });
692
- re.writeFileSync(fallbackFile, code, "utf8");
691
+ fs.mkdirSync(fallbackDir, { recursive: true });
692
+ fs.writeFileSync(fallbackFile, code, "utf8");
693
693
  moduleUrl = pathToFileURL(fallbackFile).href;
694
694
  }
695
695
  moduleUrl = moduleUrl || pathToFileURL(outFile).href;
@@ -1,6 +1,6 @@
1
1
  import { c as globalLogger } from "./main-wrcIC7dd.js";
2
2
  import { t as enableDebug } from "./debug-BmAPbhgA-CHpocWMm.js";
3
- import { a as resolveUserConfig, i as mergeConfig, n as buildWithConfigs, t as build$1 } from "./build-DU-BFLB1-Bi4na2OW.js";
3
+ import { a as resolveUserConfig, i as mergeConfig, n as buildWithConfigs, t as build$1 } from "./build-DU-BFLB1-BZ80XpcX.js";
4
4
  import * as Rolldown from "@voidzero-dev/vite-plus-core/rolldown";
5
5
  //#region ../../node_modules/.pnpm/tsdown@0.21.7_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.7_@tsdown+exe@0.21.7_@type_8e1769edffc9fa38659393584fb9975c/node_modules/tsdown/dist/config.mjs
6
6
  function defineConfig(options) {
@@ -630,7 +630,7 @@ cli.command("[...files]", "Bundle files", {
630
630
  }).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--deps.never-bundle <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims ", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: "TSDOWN_" }).option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("--root <dir>", "Root directory of input files").option("--exe", "Bundle as executable").option("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
631
631
  globalLogger.level = flags.logLevel || "info";
632
632
  globalLogger.info(`${blue`tsdown v${version}`} powered by ${hex("#ff7e17")`rolldown v${VERSION}`}`);
633
- const { build } = await import("./build-DU-BFLB1-DJDsfG2I.js").then((n) => n.r);
633
+ const { build } = await import("./build-DU-BFLB1-Dm3Ve-Np.js").then((n) => n.r);
634
634
  if (input.length > 0) flags.entry = input;
635
635
  await build(flags);
636
636
  });
@@ -72,7 +72,7 @@ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
72
72
  }));
73
73
  //#endregion
74
74
  //#region ../../vite/packages/vite/package.json
75
- var version = "8.0.5";
75
+ var version = "8.0.7";
76
76
  //#endregion
77
77
  //#region ../../vite/packages/vite/src/node/constants.ts
78
78
  const ROLLUP_HOOKS = [
@@ -16,7 +16,7 @@ import { VERSION as rolldownVersion, rolldown } from "@voidzero-dev/vite-plus-co
16
16
  import os from "node:os";
17
17
  import net from "node:net";
18
18
  import childProcess, { exec, execFile, execSync } from "node:child_process";
19
- import { promises } from "node:dns";
19
+ import { getDefaultResultOrder, promises } from "node:dns";
20
20
  import { isatty } from "node:tty";
21
21
  import path$1, { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$1, join as join$1, normalize as normalize$1, posix as posix$1, relative as relative$1, resolve as resolve$1, sep as sep$1, win32 } from "path";
22
22
  import { exactRegex, makeIdFiltersToMatchWithQuery, prefixRegex, withFilter } from "@voidzero-dev/vite-plus-core/rolldown/filter";
@@ -3912,9 +3912,11 @@ function unique(arr) {
3912
3912
  * Even if defaultResultOrder is `ipv4first`, `dns.lookup` result maybe same.
3913
3913
  * For example, when IPv6 is not supported on that machine/network.
3914
3914
  */
3915
- async function getLocalhostAddressIfDiffersFromDNS() {
3916
- const [nodeResult, dnsResult] = await Promise.all([promises.lookup("localhost"), promises.lookup("localhost", { verbatim: true })]);
3917
- return nodeResult.family === dnsResult.family && nodeResult.address === dnsResult.address ? void 0 : nodeResult.address;
3915
+ function getLocalhostAddressIfDiffersFromDNS() {
3916
+ if (getDefaultResultOrder() === "verbatim") return;
3917
+ return Promise.all([promises.lookup("localhost"), promises.lookup("localhost", { verbatim: true })]).then(([nodeResult, dnsResult]) => {
3918
+ return nodeResult.family === dnsResult.family && nodeResult.address === dnsResult.address ? void 0 : nodeResult.address;
3919
+ });
3918
3920
  }
3919
3921
  function diffDnsOrderChange(oldUrls, newUrls) {
3920
3922
  return !(oldUrls === newUrls || oldUrls && newUrls && arrayEqual(oldUrls.local, newUrls.local) && arrayEqual(oldUrls.network, newUrls.network));
@@ -4389,6 +4391,10 @@ function formatAndTruncateFileList(files) {
4389
4391
  truncated
4390
4392
  };
4391
4393
  }
4394
+ const hashbangRE = /^#!.*\n/;
4395
+ function getFileStartIndex(code) {
4396
+ return hashbangRE.exec(code)?.[0].length ?? 0;
4397
+ }
4392
4398
  //#endregion
4393
4399
  //#region ../../vite/packages/vite/src/node/plugin.ts
4394
4400
  async function resolveEnvironmentPlugins(environment) {
@@ -15913,7 +15919,6 @@ const ssrDynamicImportKey = `__vite_ssr_dynamic_import__`;
15913
15919
  const ssrExportAllKey = `__vite_ssr_exportAll__`;
15914
15920
  const ssrExportNameKey = `__vite_ssr_exportName__`;
15915
15921
  const ssrImportMetaKey = `__vite_ssr_import_meta__`;
15916
- const hashbangRE = /^#!.*\n/;
15917
15922
  async function ssrTransform(code, inMap, url, originalCode, options) {
15918
15923
  if (options?.json?.stringify && isJSONRequest(url)) return ssrTransformJSON(code, inMap);
15919
15924
  return ssrTransformScript(code, inMap, url, originalCode);
@@ -15950,7 +15955,7 @@ async function ssrTransformScript(code, inMap, url, originalCode) {
15950
15955
  const dynamicDeps = /* @__PURE__ */ new Set();
15951
15956
  const idToImportMap = /* @__PURE__ */ new Map();
15952
15957
  const declaredConst = /* @__PURE__ */ new Set();
15953
- const fileStartIndex = hashbangRE.exec(code)?.[0].length ?? 0;
15958
+ const fileStartIndex = getFileStartIndex(code);
15954
15959
  let hoistIndex = fileStartIndex;
15955
15960
  function defineImport(index, importNode, metadata) {
15956
15961
  const source = importNode.source.value;
@@ -26988,6 +26993,7 @@ const makeScssWorker = (environment, resolvers, _maxWorkers) => {
26988
26993
  const scssProcessor = (maxWorkers) => {
26989
26994
  let worker;
26990
26995
  let failedSassEmbedded;
26996
+ const normalizedErrors = /* @__PURE__ */ new WeakSet();
26991
26997
  return {
26992
26998
  close() {
26993
26999
  worker?.stop();
@@ -27023,13 +27029,16 @@ const scssProcessor = (maxWorkers) => {
27023
27029
  deps
27024
27030
  };
27025
27031
  } catch (e) {
27026
- e.message = `[sass] ${e.message}`;
27027
- e.id = e.file;
27028
- e.frame = e.formatted;
27029
- if (e.span?.start) {
27030
- e.line = e.span.start.line + 1;
27031
- e.column = e.span.start.column + 1;
27032
- e.frame = e.message;
27032
+ if (!normalizedErrors.has(e)) {
27033
+ e.message = `[sass] ${e.message}`;
27034
+ e.id = e.file;
27035
+ e.frame = e.formatted;
27036
+ if (e.span?.start) {
27037
+ e.line = e.span.start.line + 1;
27038
+ e.column = e.span.start.column + 1;
27039
+ e.frame = e.message;
27040
+ }
27041
+ normalizedErrors.add(e);
27033
27042
  }
27034
27043
  return {
27035
27044
  code: "",
@@ -33375,8 +33384,10 @@ function interopNamedImports(str, importSpecifier, rewrittenUrl, importIndex, im
33375
33384
  if (dynamicIndex > -1) str.overwrite(expStart, expEnd, `import('${rewrittenUrl}').then(m => (${interopHelperStr})(m.default, ${!!config.legacy?.inconsistentCjsInterop ? 0 : 1}))` + getLineBreaks(exp), { contentOnly: true });
33376
33385
  else {
33377
33386
  const rewritten = transformCjsImport(exp, rewrittenUrl, source.slice(start, end), importIndex, importer, isNodeMode, config);
33378
- if (rewritten) str.overwrite(expStart, expEnd, rewritten + getLineBreaks(exp), { contentOnly: true });
33379
- else str.overwrite(start, end, rewrittenUrl + getLineBreaks(source.slice(start, end)), { contentOnly: true });
33387
+ if (rewritten) {
33388
+ str.overwrite(expStart, expEnd, rewritten.importLine + getLineBreaks(exp), { contentOnly: true });
33389
+ if (rewritten.hoistedAssignments) str.appendLeft(getFileStartIndex(source), rewritten.hoistedAssignments + ";");
33390
+ } else str.overwrite(start, end, rewrittenUrl + getLineBreaks(source.slice(start, end)), { contentOnly: true });
33380
33391
  }
33381
33392
  }
33382
33393
  function getLineBreaks(str) {
@@ -33399,7 +33410,7 @@ function transformCjsImport(importExp, url, rawUrl, importIndex, importer, isNod
33399
33410
  const node = parseAst(importExp).body[0];
33400
33411
  if (config.command === "serve" && node.type === "ExportAllDeclaration" && !node.exported) config.logger.warn(import_picocolors.default.yellow(`\nUnable to interop \`${importExp}\` in ${importer}, this may lose module exports. Please export "${rawUrl}" as ESM or use named exports instead, e.g. \`export { A, B } from "${rawUrl}"\``));
33401
33412
  else if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration") {
33402
- if (!node.specifiers.length) return `import "${url}"`;
33413
+ if (!node.specifiers.length) return { importLine: `import "${url}"` };
33403
33414
  const importNames = [];
33404
33415
  const exportNames = [];
33405
33416
  let defaultExports = "";
@@ -33436,7 +33447,8 @@ function transformCjsImport(importExp, url, rawUrl, importIndex, importer, isNod
33436
33447
  }
33437
33448
  }
33438
33449
  const cjsModuleName = makeLegalIdentifier(`__vite__cjsImport${importIndex}_${rawUrl}`);
33439
- const lines = [`import ${cjsModuleName} from "${url}"`];
33450
+ const importLine = `import ${cjsModuleName} from "${url}"`;
33451
+ const lines = [];
33440
33452
  importNames.forEach(({ importedName, localName }) => {
33441
33453
  if (importedName === "*") lines.push(`const ${localName} = (${interopHelperStr})(${cjsModuleName}, ${+isNodeMode})`);
33442
33454
  else if (importedName === "default") if (isNodeMode) lines.push(`const ${localName} = ${cjsModuleName}`);
@@ -33445,7 +33457,10 @@ function transformCjsImport(importExp, url, rawUrl, importIndex, importer, isNod
33445
33457
  });
33446
33458
  if (defaultExports) lines.push(`export default ${defaultExports}`);
33447
33459
  if (exportNames.length) lines.push(`export { ${exportNames.join(", ")} }`);
33448
- return lines.join("; ");
33460
+ return {
33461
+ importLine,
33462
+ hoistedAssignments: lines.join("; ")
33463
+ };
33449
33464
  }
33450
33465
  }
33451
33466
  function getIdentifierNameOrLiteralValue(node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidzero-dev/vite-plus-core",
3
- "version": "0.1.16-alpha.4",
3
+ "version": "0.1.17-alpha.0",
4
4
  "description": "The Unified Toolchain for the Web",
5
5
  "homepage": "https://viteplus.dev/guide",
6
6
  "bugs": {
@@ -117,7 +117,7 @@
117
117
  "hookable": "^6.0.1",
118
118
  "magic-string": "^0.30.21",
119
119
  "oxc-parser": "=0.123.0",
120
- "oxfmt": "=0.43.0",
120
+ "oxfmt": "=0.44.0",
121
121
  "picocolors": "^1.1.1",
122
122
  "picomatch": "^4.0.3",
123
123
  "pkg-types": "^2.3.0",
@@ -129,7 +129,7 @@
129
129
  "tree-kill": "^1.2.2",
130
130
  "tsdown": "^0.21.7",
131
131
  "rolldown": "1.0.0-rc.13",
132
- "vite": "npm:@voidzero-dev/vite-plus-core@0.1.16-alpha.4"
132
+ "vite": "npm:@voidzero-dev/vite-plus-core@0.1.17-alpha.0"
133
133
  },
134
134
  "peerDependencies": {
135
135
  "@arethetypeswrong/core": "^0.18.1",
@@ -137,7 +137,7 @@
137
137
  "@tsdown/exe": "0.21.7",
138
138
  "@types/node": "^20.19.0 || >=22.12.0",
139
139
  "@vitejs/devtools": "^0.1.0",
140
- "esbuild": "^0.28.0",
140
+ "esbuild": "^0.27.0 || ^0.28.0",
141
141
  "jiti": ">=1.21.0",
142
142
  "less": "^4.0.0",
143
143
  "publint": "^0.3.0",
@@ -214,7 +214,7 @@
214
214
  "node": "^20.19.0 || >=22.12.0"
215
215
  },
216
216
  "bundledVersions": {
217
- "vite": "8.0.5",
217
+ "vite": "8.0.7",
218
218
  "rolldown": "1.0.0-rc.13",
219
219
  "tsdown": "0.21.7"
220
220
  },
@@ -1,2 +0,0 @@
1
- import { r as build_exports } from "./build-DU-BFLB1-Bi4na2OW.js";
2
- export { build_exports as r };