@voidzero-dev/vite-plus-core 0.1.3 → 0.1.5-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.
Files changed (50) hide show
  1. package/dist/rolldown/cli.mjs +617 -184
  2. package/dist/rolldown/config.d.mts +1 -1
  3. package/dist/rolldown/config.mjs +8 -8
  4. package/dist/rolldown/experimental-index.d.mts +2 -2
  5. package/dist/rolldown/experimental-index.mjs +8 -8
  6. package/dist/rolldown/filter-index.d.mts +1 -1
  7. package/dist/rolldown/index.d.mts +1 -1
  8. package/dist/rolldown/index.mjs +8 -8
  9. package/dist/rolldown/parallel-plugin-worker.mjs +5 -5
  10. package/dist/rolldown/parallel-plugin.d.mts +1 -1
  11. package/dist/rolldown/parse-ast-index.mjs +2 -2
  12. package/dist/rolldown/plugins-index.d.mts +2 -2
  13. package/dist/rolldown/plugins-index.mjs +3 -3
  14. package/dist/rolldown/shared/{bindingify-input-options-DdW_FOGG.mjs → bindingify-input-options-DkwIzK4F.mjs} +6 -3
  15. package/dist/rolldown/shared/{constructors-ColrbLxz.d.mts → constructors-Bnr_ApVf.d.mts} +1 -1
  16. package/dist/rolldown/shared/{constructors-CQlws1EK.mjs → constructors-D91FHkmz.mjs} +1 -1
  17. package/dist/rolldown/shared/{define-config-BqZZMLjO.d.mts → define-config-B1jccsL9.d.mts} +18 -0
  18. package/dist/rolldown/shared/{error-FTNambir.mjs → error-tpgdcGrK.mjs} +1 -1
  19. package/dist/rolldown/shared/{load-config-DBRCgd9m.mjs → load-config-Dapgaecf.mjs} +1 -1
  20. package/dist/rolldown/shared/{normalize-string-or-regex-CJTjKt5t.mjs → normalize-string-or-regex-BCllTl21.mjs} +1 -1
  21. package/dist/rolldown/shared/{parse-q7gzDQmi.mjs → parse-DFYpKkKl.mjs} +1 -1
  22. package/dist/rolldown/shared/{rolldown-BJMdRJb1.mjs → rolldown-DK6iIJl8.mjs} +1 -1
  23. package/dist/rolldown/shared/{rolldown-build-DKv2K096.mjs → rolldown-build-rw0HCMhn.mjs} +9 -6
  24. package/dist/rolldown/shared/{transform-CQppMqL8.mjs → transform-BSCulZAO.mjs} +2 -2
  25. package/dist/rolldown/shared/{watch-BeMWbIuq.mjs → watch-D8uEZyLj.mjs} +4 -4
  26. package/dist/rolldown/utils-index.mjs +4 -4
  27. package/dist/tsdown/{build-TmLngPCw-CBoVPzkZ.js → build-BG-XbM6V-hoyhQqI3.js} +41 -153
  28. package/dist/tsdown/build-DHPfiKA--CvTonTfC.js +5 -0
  29. package/dist/tsdown/{debug-tOJ_PtrM-C-Do1Twv.js → debug-C4FmgzkJ-B6m_gRpz.js} +2 -2
  30. package/dist/tsdown/{detect-DK-FDZQ9-CHuRhyUG.js → detect-J1_Vd1yf-BWDiPZkP.js} +1 -1
  31. package/dist/tsdown/{dist-DCol2bGA.js → dist-C9Oecl0H.js} +2 -2
  32. package/dist/tsdown/{dist-Ba2DZx1w.js → dist-Dx-jtFHM.js} +2 -4
  33. package/dist/tsdown/{index-node-Djp92Gzb-B-AUHI4t.js → index-node-Bpsmc0eX-jMz9gD3P.js} +1 -1
  34. package/dist/tsdown/index-types.d.ts +8556 -176
  35. package/dist/tsdown/index.js +5 -5
  36. package/dist/tsdown/{main-DYgM-9Cb.js → main-DN-_H9u2.js} +3 -3
  37. package/dist/tsdown/run.js +3 -3
  38. package/dist/tsdown/{tsc-CberiTDq.js → tsc-OwK9UHsV.js} +1 -1
  39. package/dist/vite/client/client.mjs +112 -0
  40. package/dist/vite/node/chunks/logger.js +1 -1
  41. package/dist/vite/node/chunks/node.js +823 -494
  42. package/dist/vite/node/cli.js +201 -63
  43. package/dist/vite/node/index.d.ts +15 -12
  44. package/dist/vite/node/index.js +1 -1
  45. package/dist/vite/node/module-runner.d.ts +5 -1
  46. package/dist/vite/types/customEvent.d.ts +27 -0
  47. package/package.json +9 -9
  48. package/dist/tsdown/build-gOkJM1H9-D9ngUBpk.js +0 -5
  49. /package/dist/rolldown/shared/{binding-COZdHtee.mjs → binding-BSVL02lq.mjs} +0 -0
  50. /package/dist/tsdown/{filename-BDcjeHGl.js → filename-tIvGuRvQ.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { r as __toESM, t as __commonJSMin } from "./chunk-CSNpwdVU.js";
2
- import { C as resolveComma, E as toArray, S as promiseWithResolvers, T as slash, _ as debounce, a as createLogger, b as noop, c as globalLogger, d as bold, f as dim, g as yellow, h as underline, i as LogLevels, l as prettyFormat, m as red, n as q, o as generateColor, p as green, r as version, s as getNameLabel, t as K, u as blue, v as importWithError, w as resolveRegex, x as pkgExists, y as matchPattern } from "./main-DYgM-9Cb.js";
2
+ import { C as resolveComma, E as toArray, S as promiseWithResolvers, T as slash, _ as debounce, a as createLogger, b as noop, c as globalLogger, d as bold, f as dim, g as yellow, h as underline, i as LogLevels, l as prettyFormat, m as red, n as q, o as generateColor, p as green, r as version, s as getNameLabel, t as K, u as blue, v as importWithError, w as resolveRegex, x as pkgExists, y as matchPattern } from "./main-DN-_H9u2.js";
3
3
  import { t as createDebug } from "./node-B3Gdtau1.js";
4
- import { i as RE_JS, n as RE_DTS, o as RE_NODE_MODULES$1, t as RE_CSS$1 } from "./filename-BDcjeHGl.js";
4
+ import { i as RE_JS, n as RE_DTS, o as RE_NODE_MODULES$1, t as RE_CSS } from "./filename-tIvGuRvQ.js";
5
5
  import module$1, { builtinModules, createRequire, isBuiltin } from "node:module";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import process$1, { env } from "node:process";
@@ -21,7 +21,7 @@ import fs$1, { existsSync, readFileSync, writeFileSync } from "node:fs";
21
21
  import { Buffer } from "node:buffer";
22
22
  import { brotliCompress, gzip } from "node:zlib";
23
23
  import { importGlobPlugin } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
24
- //#region ../../node_modules/.pnpm/tsdown@0.21.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.0_@tsdown+exe@0.21.0_@type_df9c58766eba71ed4fabe78a2cfe9dc9/node_modules/tsdown/dist/format-CM79ZE77.mjs
24
+ //#region ../../node_modules/.pnpm/tsdown@0.21.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.1_@tsdown+exe@0.21.1_@type_441010dc1e356451b27baacd78ca9eda/node_modules/tsdown/dist/fs-Dd6Htx2P.mjs
25
25
  function fsExists(path) {
26
26
  return access(path).then(() => true, () => false);
27
27
  }
@@ -63,6 +63,8 @@ function stripExtname(filePath) {
63
63
  if (!ext.length) return filePath;
64
64
  return filePath.slice(0, -ext.length);
65
65
  }
66
+ //#endregion
67
+ //#region ../../node_modules/.pnpm/tsdown@0.21.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.1_@tsdown+exe@0.21.1_@type_441010dc1e356451b27baacd78ca9eda/node_modules/tsdown/dist/format-CEIo9KZy.mjs
66
68
  const shimFile = path.resolve(import.meta.dirname, "..", "esm-shims.js");
67
69
  function getShimsInject(format, platform) {
68
70
  if (format === "es" && platform === "node") return {
@@ -213,25 +215,6 @@ function detectIndentation(jsonText) {
213
215
  return 2;
214
216
  }
215
217
  //#endregion
216
- //#region ../../node_modules/.pnpm/tsdown@0.21.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.0_@tsdown+exe@0.21.0_@type_df9c58766eba71ed4fabe78a2cfe9dc9/node_modules/tsdown/dist/css-CzF_A79W.mjs
217
- const defaultCssBundleName = "style.css";
218
- function resolveCssOptions(options = {}, topLevelTarget) {
219
- let cssTarget;
220
- if (options.target === false) cssTarget = void 0;
221
- else if (options.target == null) cssTarget = topLevelTarget;
222
- else cssTarget = resolveComma(toArray(options.target));
223
- return {
224
- transformer: options.transformer ?? "lightningcss",
225
- splitting: options.splitting ?? false,
226
- fileName: options.fileName ?? "style.css",
227
- minify: options.minify ?? false,
228
- target: cssTarget,
229
- preprocessorOptions: options.preprocessorOptions,
230
- lightningcss: options.lightningcss,
231
- postcss: options.postcss
232
- };
233
- }
234
- //#endregion
235
218
  //#region ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
236
219
  function isPlainObject(value) {
237
220
  if (value === null || typeof value !== "object") return false;
@@ -3088,7 +3071,7 @@ function createConfigCoreLoader(options) {
3088
3071
  };
3089
3072
  }
3090
3073
  //#endregion
3091
- //#region ../../node_modules/.pnpm/tsdown@0.21.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.0_@tsdown+exe@0.21.0_@type_df9c58766eba71ed4fabe78a2cfe9dc9/node_modules/tsdown/dist/options-DpJJmGDp.mjs
3074
+ //#region ../../node_modules/.pnpm/tsdown@0.21.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.1_@tsdown+exe@0.21.1_@type_441010dc1e356451b27baacd78ca9eda/node_modules/tsdown/dist/options-CQzuh3xe.mjs
3092
3075
  const __cjs_require$1 = createRequire(import.meta.url);
3093
3076
  const picomatch = __cjs_require$1("./npm_entry_picomatch.cjs");
3094
3077
  const satisfies$1 = __cjs_require$1("./npm_entry_semver_functions_satisfies.cjs");
@@ -3403,9 +3386,9 @@ function exportMeta(exports, all, packageJson) {
3403
3386
  if (all) exports["./*"] = "./*";
3404
3387
  else if (packageJson) exports["./package.json"] = "./package.json";
3405
3388
  }
3406
- function exportCss(exports, chunks, { splitting }, pkgRoot) {
3407
- if (splitting) return;
3408
- for (const chunksByFormat of Object.values(chunks)) for (const chunk of chunksByFormat) if (chunk.type === "asset" && RE_CSS$1.test(chunk.fileName)) {
3389
+ function exportCss(exports, chunks, css, pkgRoot) {
3390
+ if (css?.splitting) return;
3391
+ for (const chunksByFormat of Object.values(chunks)) for (const chunk of chunksByFormat) if (chunk.type === "asset" && RE_CSS.test(chunk.fileName)) {
3409
3392
  const filename = slash(chunk.fileName);
3410
3393
  exports[`./${filename}`] = join$1(pkgRoot, chunk.outDir, filename);
3411
3394
  return;
@@ -3639,7 +3622,7 @@ async function nativeImport(id) {
3639
3622
  return mod.default || mod;
3640
3623
  }
3641
3624
  async function unrunImport(id) {
3642
- const { unrun } = await import("./dist-Ba2DZx1w.js");
3625
+ const { unrun } = await import("./dist-Dx-jtFHM.js");
3643
3626
  const { module } = await unrun({ path: pathToFileURL(id).href });
3644
3627
  return module;
3645
3628
  }
@@ -3652,7 +3635,7 @@ const parseEnv = process$1.getBuiltinModule("node:util").parseEnv;
3652
3635
  * @private
3653
3636
  */
3654
3637
  async function resolveUserConfig(userConfig, inlineConfig) {
3655
- let { entry, format, plugins = [], clean = true, logLevel = "info", failOnWarn = false, customLogger, treeshake = true, platform = "node", outDir = "dist", sourcemap = false, dts, unused = false, watch = false, ignoreWatch, shims = false, publint = false, attw = false, fromVite, alias, tsconfig, report = true, target, env = {}, envFile, envPrefix = "TSDOWN_", copy, publicDir, hash = true, cwd = process$1.cwd(), name, workspace, exports = false, bundle, unbundle = typeof bundle === "boolean" ? !bundle : false, removeNodeProtocol, nodeProtocol, cjsDefault = true, globImport = true, css, fixedExtension = platform === "node", devtools = false, write = true, exe = false } = userConfig;
3638
+ let { entry, format, plugins = [], clean = true, logLevel = "info", failOnWarn = false, customLogger, treeshake = true, platform = "node", outDir = "dist", sourcemap = false, dts, unused = false, watch = false, ignoreWatch, shims = false, publint = false, attw = false, fromVite, alias, tsconfig, report = true, target, env = {}, envFile, envPrefix = "TSDOWN_", copy, publicDir, hash = true, cwd = process$1.cwd(), name, workspace, exports = false, bundle, unbundle = typeof bundle === "boolean" ? !bundle : false, removeNodeProtocol, nodeProtocol, cjsDefault = true, globImport = true, css, injectStyle, fixedExtension = platform === "node", devtools = false, write = true, exe = false } = userConfig;
3656
3639
  const pkg = await readPackageJson(cwd);
3657
3640
  if (workspace) name ||= pkg?.name;
3658
3641
  const color = generateColor(name);
@@ -3690,6 +3673,13 @@ async function resolveUserConfig(userConfig, inlineConfig) {
3690
3673
  if (publint) logger.warn(nameLabel, "publint is enabled but package.json is not found");
3691
3674
  if (attw) logger.warn(nameLabel, "attw is enabled but package.json is not found");
3692
3675
  }
3676
+ if (injectStyle != null) if (css?.inject == null) {
3677
+ logger.warn(`${blue`injectStyle`} is deprecated. Use ${blue`css.inject`} instead.`);
3678
+ css = {
3679
+ ...css,
3680
+ inject: injectStyle
3681
+ };
3682
+ } else throw new TypeError("`injectStyle` is deprecated. Cannot be used with `css.inject`");
3693
3683
  if (publicDir) if (copy) throw new TypeError("`publicDir` is deprecated. Cannot be used with `copy`");
3694
3684
  else logger.warn(`${blue`publicDir`} is deprecated. Use ${blue`copy`} instead.`);
3695
3685
  envPrefix = toArray(envPrefix);
@@ -3739,7 +3729,7 @@ async function resolveUserConfig(userConfig, inlineConfig) {
3739
3729
  cjsDefault,
3740
3730
  clean,
3741
3731
  copy: publicDir || copy,
3742
- css: resolveCssOptions(css, target),
3732
+ css,
3743
3733
  cwd,
3744
3734
  deps: depsConfig,
3745
3735
  devtools,
@@ -3824,118 +3814,7 @@ function filterConfig(filter, configCwd, name) {
3824
3814
  return toArray(filter).some((value) => name && name === value || cwd === value);
3825
3815
  }
3826
3816
  //#endregion
3827
- //#region ../../node_modules/.pnpm/tsdown@0.21.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.0_@tsdown+exe@0.21.0_@type_df9c58766eba71ed4fabe78a2cfe9dc9/node_modules/tsdown/dist/plugin-BQv869Ce.mjs
3828
- /**
3829
- * Detect and remove "pure CSS chunks" — JS chunks that exist only because
3830
- * they imported CSS files. These chunks have no JS exports and all their
3831
- * modules are CSS. Following Vite's implementation.
3832
- */
3833
- function removePureCssChunks(bundle, styles) {
3834
- const pureCssChunkNames = [];
3835
- for (const [fileName, chunk] of Object.entries(bundle)) {
3836
- if (chunk.type !== "chunk") continue;
3837
- if (chunk.exports.length > 0) continue;
3838
- const moduleIds = Object.keys(chunk.modules);
3839
- if (moduleIds.length === 0) continue;
3840
- if (!moduleIds.every((id) => styles.has(id))) continue;
3841
- pureCssChunkNames.push(fileName);
3842
- }
3843
- if (!pureCssChunkNames.length) return;
3844
- const replaceEmptyChunk = getEmptyChunkReplacer(pureCssChunkNames);
3845
- for (const file of Object.keys(bundle)) {
3846
- const chunk = bundle[file];
3847
- if (chunk.type !== "chunk") continue;
3848
- let chunkImportsPureCssChunk = false;
3849
- chunk.imports = chunk.imports.filter((importFile) => {
3850
- if (pureCssChunkNames.includes(importFile)) {
3851
- chunkImportsPureCssChunk = true;
3852
- return false;
3853
- }
3854
- return true;
3855
- });
3856
- if (chunkImportsPureCssChunk) chunk.code = replaceEmptyChunk(chunk.code);
3857
- }
3858
- for (const fileName of pureCssChunkNames) {
3859
- delete bundle[fileName];
3860
- delete bundle[`${fileName}.map`];
3861
- }
3862
- }
3863
- /**
3864
- * Create a replacer function that replaces import statements for pure CSS
3865
- * chunks with block comments of the same length, preserving source map offsets.
3866
- */
3867
- function getEmptyChunkReplacer(pureCssChunkNames) {
3868
- const emptyChunkFiles = pureCssChunkNames.map((file) => escapeRegex(path.basename(file))).join("|");
3869
- const emptyChunkRE = new RegExp(String.raw`\bimport\s*["'][^"']*(?:${emptyChunkFiles})["'];`, "g");
3870
- return (code) => code.replace(emptyChunkRE, (m) => {
3871
- return `/* empty css ${"".padEnd(m.length - 15)}*/`;
3872
- });
3873
- }
3874
- function escapeRegex(str) {
3875
- return str.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`);
3876
- }
3877
- function createCssPostHooks(config, styles) {
3878
- const collectedCSS = [];
3879
- return {
3880
- renderChunk(_code, chunk) {
3881
- let chunkCSS = "";
3882
- for (const id of Object.keys(chunk.modules)) {
3883
- const code = styles.get(id);
3884
- if (code) chunkCSS += code;
3885
- }
3886
- if (!chunkCSS) return;
3887
- if (chunkCSS.length > 0 && !chunkCSS.endsWith("\n")) chunkCSS += "\n";
3888
- if (config.css.splitting) {
3889
- const cssAssetFileName = chunk.fileName.replace(/\.(m?js|cjs)$/, ".css");
3890
- this.emitFile({
3891
- type: "asset",
3892
- fileName: cssAssetFileName,
3893
- source: chunkCSS
3894
- });
3895
- } else collectedCSS.push(chunkCSS);
3896
- },
3897
- generateBundle(_outputOptions, bundle) {
3898
- if (!config.css.splitting && collectedCSS.length > 0) {
3899
- const allCSS = collectedCSS.join("");
3900
- if (allCSS) this.emitFile({
3901
- type: "asset",
3902
- fileName: config.css.fileName,
3903
- source: allCSS,
3904
- originalFileName: defaultCssBundleName
3905
- });
3906
- collectedCSS.length = 0;
3907
- }
3908
- removePureCssChunks(bundle, styles);
3909
- }
3910
- };
3911
- }
3912
- const RE_CSS = /\.css(?:$|\?)/;
3913
- function CssPlugin(config) {
3914
- const styles = /* @__PURE__ */ new Map();
3915
- const postHooks = createCssPostHooks(config, styles);
3916
- return {
3917
- name: "tsdown:builtin-css",
3918
- buildStart() {
3919
- styles.clear();
3920
- },
3921
- load: {
3922
- filter: { id: RE_CSS },
3923
- async handler(id) {
3924
- let code = await readFile(id, "utf8");
3925
- if (code.length > 0 && !code.endsWith("\n")) code += "\n";
3926
- styles.set(id, code);
3927
- return {
3928
- code: "",
3929
- moduleSideEffects: "no-treeshake",
3930
- moduleType: "js"
3931
- };
3932
- }
3933
- },
3934
- ...postHooks
3935
- };
3936
- }
3937
- //#endregion
3938
- //#region ../../node_modules/.pnpm/tsdown@0.21.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.0_@tsdown+exe@0.21.0_@type_df9c58766eba71ed4fabe78a2cfe9dc9/node_modules/tsdown/dist/watch-BAbxxJcJ.mjs
3817
+ //#region ../../node_modules/.pnpm/tsdown@0.21.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.1_@tsdown+exe@0.21.1_@type_441010dc1e356451b27baacd78ca9eda/node_modules/tsdown/dist/watch-yZCV-ZeB.mjs
3939
3818
  /**
3940
3819
  * The `node:` protocol was added in Node.js v14.18.0.
3941
3820
  * @see https://nodejs.org/api/esm.html#node-imports
@@ -4264,7 +4143,7 @@ var Hookable = class {
4264
4143
  }
4265
4144
  };
4266
4145
  //#endregion
4267
- //#region ../../node_modules/.pnpm/tsdown@0.21.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.0_@tsdown+exe@0.21.0_@type_df9c58766eba71ed4fabe78a2cfe9dc9/node_modules/tsdown/dist/build-TmLngPCw.mjs
4146
+ //#region ../../node_modules/.pnpm/tsdown@0.21.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.1_@tsdown+exe@0.21.1_@type_441010dc1e356451b27baacd78ca9eda/node_modules/tsdown/dist/build-BG-XbM6V.mjs
4268
4147
  const __cjs_require = createRequire(import.meta.url);
4269
4148
  const satisfies = __cjs_require("./npm_entry_semver_functions_satisfies.cjs");
4270
4149
  const coerce = __cjs_require("./npm_entry_semver_functions_coerce.cjs");
@@ -4600,7 +4479,7 @@ async function bundleDone(bundleByPkg, bundle) {
4600
4479
  async function packTarball(packageJsonPath) {
4601
4480
  const pkgDir = path.dirname(packageJsonPath);
4602
4481
  const destination = await mkdtemp(path.join(tmpdir(), "tsdown-pack-"));
4603
- const [{ detect }, { pack }] = await Promise.all([import("./detect-DK-FDZQ9-CHuRhyUG.js"), import("./index-node-Djp92Gzb-B-AUHI4t.js")]);
4482
+ const [{ detect }, { pack }] = await Promise.all([import("./detect-J1_Vd1yf-BWDiPZkP.js"), import("./index-node-Bpsmc0eX-jMz9gD3P.js")]);
4604
4483
  try {
4605
4484
  const detected = await detect({ cwd: pkgDir });
4606
4485
  if (detected?.name === "deno") throw new Error(`Cannot pack tarball for Deno projects at ${pkgDir}`);
@@ -4677,7 +4556,7 @@ function resolveChunkAddon(chunkAddon, format) {
4677
4556
  if (typeof chunkAddon === "string") return chunkAddon;
4678
4557
  switch (true) {
4679
4558
  case RE_JS.test(chunk.fileName): return chunkAddon?.js || "";
4680
- case RE_CSS$1.test(chunk.fileName): return chunkAddon?.css || "";
4559
+ case RE_CSS.test(chunk.fileName): return chunkAddon?.css || "";
4681
4560
  case RE_DTS.test(chunk.fileName): return chunkAddon?.dts || "";
4682
4561
  default: return "";
4683
4562
  }
@@ -4701,7 +4580,7 @@ async function resolveInputOptions(config, format, configFiles, bundle, cjsDts,
4701
4580
  if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
4702
4581
  if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepPlugin(config, bundle));
4703
4582
  if (dts) {
4704
- const { dts: dtsPlugin } = await import("./dist-DCol2bGA.js");
4583
+ const { dts: dtsPlugin } = await import("./dist-C9Oecl0H.js");
4705
4584
  const options = {
4706
4585
  tsconfig,
4707
4586
  ...dts
@@ -4721,14 +4600,11 @@ async function resolveInputOptions(config, format, configFiles, bundle, cjsDts,
4721
4600
  ...unused
4722
4601
  }));
4723
4602
  }
4724
- let cssPlugin;
4725
- try {
4726
- const { CssPlugin: AdvancedCssPlugin } = await import("@tsdown/css");
4727
- cssPlugin = AdvancedCssPlugin(config, { logger });
4728
- } catch {
4729
- cssPlugin = CssPlugin(config);
4730
- }
4731
- plugins.push(cssPlugin, ShebangPlugin(logger, cwd, nameLabel, isDualFormat));
4603
+ if (pkgExists("@tsdown/css")) {
4604
+ const { CssPlugin } = await import("@tsdown/css");
4605
+ plugins.push(CssPlugin(config, { logger }));
4606
+ } else plugins.push(CssGuardPlugin());
4607
+ plugins.push(ShebangPlugin(logger, cwd, nameLabel, isDualFormat));
4732
4608
  if (globImport) plugins.push(importGlobPlugin({ root: cwd }));
4733
4609
  }
4734
4610
  if (report && LogLevels[logger.level] >= 3) plugins.push(ReportPlugin(config, cjsDts, isDualFormat));
@@ -4823,6 +4699,18 @@ function handlePluginInspect(plugins) {
4823
4699
  else return `"rolldown plugin: ${plugins.name}"`;
4824
4700
  };
4825
4701
  }
4702
+ function CssGuardPlugin() {
4703
+ return {
4704
+ name: "tsdown:css-guard",
4705
+ transform: {
4706
+ order: "post",
4707
+ filter: { id: /\.(?:css|less|sass|scss|styl|stylus)$/ },
4708
+ handler(_code, id) {
4709
+ throw new Error(`CSS file "${id}" was encountered but \`@tsdown/css\` is not installed. Please install it: \`npm install @tsdown/css\``);
4710
+ }
4711
+ }
4712
+ };
4713
+ }
4826
4714
  function shortcuts(restart) {
4827
4715
  let actionRunning = false;
4828
4716
  async function onInput(input) {
@@ -0,0 +1,5 @@
1
+ import "./main-DN-_H9u2.js";
2
+ import "./node-B3Gdtau1.js";
3
+ import { t as build$1 } from "./build-BG-XbM6V-hoyhQqI3.js";
4
+ import "./filename-tIvGuRvQ.js";
5
+ export { build$1 as build };
@@ -1,6 +1,6 @@
1
- import { C as resolveComma, E as toArray } from "./main-DYgM-9Cb.js";
1
+ import { C as resolveComma, E as toArray } from "./main-DN-_H9u2.js";
2
2
  import { n as enable, r as namespaces, t as createDebug } from "./node-B3Gdtau1.js";
3
- //#region ../../node_modules/.pnpm/tsdown@0.21.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.0_@tsdown+exe@0.21.0_@type_df9c58766eba71ed4fabe78a2cfe9dc9/node_modules/tsdown/dist/debug-tOJ_PtrM.mjs
3
+ //#region ../../node_modules/.pnpm/tsdown@0.21.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.1_@tsdown+exe@0.21.1_@type_441010dc1e356451b27baacd78ca9eda/node_modules/tsdown/dist/debug-C4FmgzkJ.mjs
4
4
  const debugLog = createDebug("tsdown:debug");
5
5
  function enableDebug(debug) {
6
6
  if (!debug) return;
@@ -1,7 +1,7 @@
1
1
  import process from "node:process";
2
2
  import path from "node:path";
3
3
  import fs from "node:fs/promises";
4
- //#region ../../node_modules/.pnpm/tsdown@0.21.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.0_@tsdown+exe@0.21.0_@type_df9c58766eba71ed4fabe78a2cfe9dc9/node_modules/tsdown/dist/detect-DK-FDZQ9.mjs
4
+ //#region ../../node_modules/.pnpm/tsdown@0.21.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.1_@tsdown+exe@0.21.1_@type_441010dc1e356451b27baacd78ca9eda/node_modules/tsdown/dist/detect-J1_Vd1yf.mjs
5
5
  const AGENTS = [
6
6
  "npm",
7
7
  "yarn",
@@ -1,6 +1,6 @@
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
- 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-BDcjeHGl.js";
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-tIvGuRvQ.js";
4
4
  import { n as globalContext, r as invalidateContextFile, t as createContext } from "./tsc-context-DiIjfXAG.js";
5
5
  import module$1, { createRequire } from "node:module";
6
6
  import process$1 from "node:process";
@@ -31938,7 +31938,7 @@ function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd,
31938
31938
  on: (fn) => childProcess.on("message", fn)
31939
31939
  });
31940
31940
  } else {
31941
- tscModule = await import("./tsc-CberiTDq.js");
31941
+ tscModule = await import("./tsc-OwK9UHsV.js");
31942
31942
  if (newContext) tscContext = createContext();
31943
31943
  }
31944
31944
  if (!Array.isArray(options.input)) for (const [name, id] of Object.entries(options.input)) {
@@ -8,7 +8,7 @@ import { tmpdir } from "node:os";
8
8
  import fs, { existsSync } from "node:fs";
9
9
  import { Buffer } from "node:buffer";
10
10
  import crypto from "node:crypto";
11
- //#region ../../node_modules/.pnpm/unrun@0.2.30/node_modules/unrun/dist/load-module-CeH7YHFU.mjs
11
+ //#region ../../node_modules/.pnpm/unrun@0.2.31/node_modules/unrun/dist/src-GU5PtktT.mjs
12
12
  /**
13
13
  * Applies preset-specific handling to the loaded module.
14
14
  */
@@ -715,8 +715,6 @@ async function loadModule(code, options) {
715
715
  }
716
716
  return _module;
717
717
  }
718
- //#endregion
719
- //#region ../../node_modules/.pnpm/unrun@0.2.30/node_modules/unrun/dist/index.mjs
720
718
  /**
721
719
  * Loads a module with JIT transpilation based on the provided options.
722
720
  *
@@ -730,7 +728,7 @@ async function unrun(options) {
730
728
  try {
731
729
  module = await loadModule(output.chunk.code, resolvedOptions);
732
730
  } catch (error) {
733
- throw new Error(`[unrun] Import failed (code length: ${output.chunk.code.length}): ${error.message}`);
731
+ throw new Error(`[unrun] Import failed (code length: ${output.chunk.code.length}): ${error.message}`, { cause: error });
734
732
  }
735
733
  return {
736
734
  module: preset(resolvedOptions, module),
@@ -4,7 +4,7 @@ import path from "node:path";
4
4
  import fs from "node:fs/promises";
5
5
  import os from "node:os";
6
6
  import zlib from "node:zlib";
7
- //#region ../../node_modules/.pnpm/tsdown@0.21.0_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.0_@tsdown+exe@0.21.0_@type_df9c58766eba71ed4fabe78a2cfe9dc9/node_modules/tsdown/dist/index-node-Djp92Gzb.mjs
7
+ //#region ../../node_modules/.pnpm/tsdown@0.21.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.1_@tsdown+exe@0.21.1_@type_441010dc1e356451b27baacd78ca9eda/node_modules/tsdown/dist/index-node-Bpsmc0eX.mjs
8
8
  /** @type {import('../index.d.ts').pack} */
9
9
  async function pack(dir, opts) {
10
10
  const packageManager = opts?.packageManager ?? "npm";