tsdown 0.16.6 → 0.16.7

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.
@@ -1,4 +1,4 @@
1
- import { d as UserConfig, f as UserConfigExport, p as UserConfigFn } from "./index-BcO8yjl6.mjs";
1
+ import { f as UserConfig, m as UserConfigFn, p as UserConfigExport } from "./index-QuvuIHHG.mjs";
2
2
 
3
3
  //#region src/config.d.ts
4
4
 
package/dist/config.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { d as UserConfig, f as UserConfigExport, p as UserConfigFn } from "./index-BcO8yjl6.mjs";
2
- import { t as defineConfig } from "./config-BNLClkOs.mjs";
1
+ import { f as UserConfig, m as UserConfigFn, p as UserConfigExport } from "./index-QuvuIHHG.mjs";
2
+ import { t as defineConfig } from "./config-BYPCbyiH.mjs";
3
3
  export { UserConfig, UserConfigExport, UserConfigFn, defineConfig };
@@ -200,6 +200,7 @@ interface Workspace {
200
200
  config?: boolean | string;
201
201
  }
202
202
  type NoExternalFn = (id: string, importer: string | undefined) => boolean | null | undefined | void;
203
+ type CIOption = "ci-only" | "local-only";
203
204
  /**
204
205
  * Options for tsdown.
205
206
  */
@@ -330,7 +331,7 @@ interface UserConfig {
330
331
  inputOptions?: InputOptions | ((options: InputOptions, format: NormalizedFormat, context: {
331
332
  cjsDts: boolean;
332
333
  }) => Awaitable<InputOptions | void | null>);
333
- /** @default ['es'] */
334
+ /** @default 'es' */
334
335
  format?: Format | Format[];
335
336
  globalName?: string;
336
337
  /** @default 'dist' */
@@ -423,7 +424,7 @@ interface UserConfig {
423
424
  * If true, fails the build on warnings.
424
425
  * @default false
425
426
  */
426
- failOnWarn?: boolean;
427
+ failOnWarn?: boolean | CIOption;
427
428
  /**
428
429
  * Custom logger.
429
430
  */
@@ -451,7 +452,7 @@ interface UserConfig {
451
452
  *
452
453
  * @default false
453
454
  */
454
- debug?: boolean | DebugOptions;
455
+ debug?: boolean | CIOption | DebugOptions;
455
456
  /**
456
457
  * Enables generation of TypeScript declaration files (`.d.ts`).
457
458
  *
@@ -459,19 +460,19 @@ interface UserConfig {
459
460
  * - If the `types` field is present, or if the main `exports` contains a `types` entry, declaration file generation is enabled by default.
460
461
  * - Otherwise, declaration file generation is disabled by default.
461
462
  */
462
- dts?: boolean | DtsOptions;
463
+ dts?: boolean | CIOption | DtsOptions;
463
464
  /**
464
465
  * Enable unused dependencies check with `unplugin-unused`
465
466
  * Requires `unplugin-unused` to be installed.
466
467
  * @default false
467
468
  */
468
- unused?: boolean | UnusedOptions;
469
+ unused?: boolean | CIOption | UnusedOptions;
469
470
  /**
470
471
  * Run publint after bundling.
471
472
  * Requires `publint` to be installed.
472
473
  * @default false
473
474
  */
474
- publint?: boolean | PublintOptions;
475
+ publint?: boolean | CIOption | PublintOptions;
475
476
  /**
476
477
  * Run `arethetypeswrong` after bundling.
477
478
  * Requires `@arethetypeswrong/core` to be installed.
@@ -479,12 +480,12 @@ interface UserConfig {
479
480
  * @default false
480
481
  * @see https://github.com/arethetypeswrong/arethetypeswrong.github.io
481
482
  */
482
- attw?: boolean | AttwOptions;
483
+ attw?: boolean | CIOption | AttwOptions;
483
484
  /**
484
485
  * Enable size reporting after bundling.
485
486
  * @default true
486
487
  */
487
- report?: boolean | ReportOptions;
488
+ report?: boolean | CIOption | ReportOptions;
488
489
  /**
489
490
  * `import.meta.glob` support.
490
491
  * @see https://vite.dev/guide/features.html#glob-import
@@ -497,7 +498,7 @@ interface UserConfig {
497
498
  * This will set the `main`, `module`, `types`, `exports` fields in `package.json`
498
499
  * to point to the generated files.
499
500
  */
500
- exports?: boolean | ExportsOptions;
501
+ exports?: boolean | CIOption | ExportsOptions;
501
502
  /**
502
503
  * @deprecated Alias for `copy`, will be removed in the future.
503
504
  */
@@ -535,23 +536,28 @@ interface InlineConfig extends UserConfig {
535
536
  */
536
537
  filter?: RegExp | string | string[];
537
538
  }
538
- type UserConfigFn = (inlineConfig: InlineConfig) => Awaitable<Arrayable<UserConfig>>;
539
+ type UserConfigFn = (inlineConfig: InlineConfig, context: {
540
+ ci: boolean;
541
+ }) => Awaitable<Arrayable<UserConfig>>;
539
542
  type UserConfigExport = Awaitable<Arrayable<UserConfig> | UserConfigFn>;
540
543
  type ResolvedConfig = Overwrite<MarkPartial<Omit<UserConfig, "workspace" | "fromVite" | "publicDir" | "silent" | "bundle" | "removeNodeProtocol" | "logLevel" | "failOnWarn" | "customLogger">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "external" | "onSuccess" | "outExtensions" | "hooks" | "copy" | "loader" | "name" | "banner" | "footer">, {
541
544
  format: NormalizedFormat[];
542
545
  target?: string[];
543
546
  clean: string[];
544
- dts: false | DtsOptions;
545
- report: false | ReportOptions;
546
- tsconfig: false | string;
547
547
  pkg?: PackageJson;
548
- exports: false | ExportsOptions;
549
548
  nodeProtocol: "strip" | boolean;
550
549
  logger: Logger;
551
550
  ignoreWatch: Array<string | RegExp>;
552
551
  noExternal?: NoExternalFn;
553
552
  inlineOnly?: Array<string | RegExp>;
553
+ dts: false | DtsOptions;
554
+ report: false | ReportOptions;
555
+ tsconfig: false | string;
556
+ exports: false | ExportsOptions;
554
557
  debug: false | DebugOptions;
558
+ publint: false | PublintOptions;
559
+ attw: false | AttwOptions;
560
+ unused: false | UnusedOptions;
555
561
  }>;
556
562
  //#endregion
557
- export { TsdownChunks as A, OutExtensionFactory as C, RolldownContext as D, BuildContext as E, AttwOptions as F, CopyEntry as M, CopyOptions as N, TsdownHooks as O, CopyOptionsFn as P, OutExtensionContext as S, PackageType as T, Logger as _, NormalizedFormat as a, ChunkAddonFunction as b, Sourcemap as c, UserConfig as d, UserConfigExport as f, ReportPlugin as g, ReportOptions as h, NoExternalFn as i, DebugOptions as j, ExportsOptions as k, TreeshakingOptions as l, Workspace as m, Format as n, PublintOptions as o, UserConfigFn as p, InlineConfig as r, ResolvedConfig as s, DtsOptions as t, UnusedOptions as u, globalLogger as v, OutExtensionObject as w, ChunkAddonObject as x, ChunkAddon as y };
563
+ export { ExportsOptions as A, OutExtensionContext as C, BuildContext as D, PackageType as E, CopyOptionsFn as F, AttwOptions as I, DebugOptions as M, CopyEntry as N, RolldownContext as O, CopyOptions as P, ChunkAddonObject as S, OutExtensionObject as T, ReportPlugin as _, NoExternalFn as a, ChunkAddon as b, ResolvedConfig as c, UnusedOptions as d, UserConfig as f, ReportOptions as g, Workspace as h, InlineConfig as i, TsdownChunks as j, TsdownHooks as k, Sourcemap as l, UserConfigFn as m, DtsOptions as n, NormalizedFormat as o, UserConfigExport as p, Format as r, PublintOptions as s, CIOption as t, TreeshakingOptions as u, Logger as v, OutExtensionFactory as w, ChunkAddonFunction as x, globalLogger as y };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as TsdownChunks, C as OutExtensionFactory, D as RolldownContext, E as BuildContext, F as AttwOptions, M as CopyEntry, N as CopyOptions, O as TsdownHooks, P as CopyOptionsFn, S as OutExtensionContext, T as PackageType, _ as Logger, a as NormalizedFormat, b as ChunkAddonFunction, c as Sourcemap, d as UserConfig, f as UserConfigExport, h as ReportOptions, i as NoExternalFn, j as DebugOptions, k as ExportsOptions, l as TreeshakingOptions, m as Workspace, n as Format, o as PublintOptions, p as UserConfigFn, r as InlineConfig, s as ResolvedConfig, t as DtsOptions, u as UnusedOptions, v as globalLogger, w as OutExtensionObject, x as ChunkAddonObject, y as ChunkAddon } from "./index-BcO8yjl6.mjs";
2
- import { t as defineConfig } from "./config-BNLClkOs.mjs";
1
+ import { A as ExportsOptions, C as OutExtensionContext, D as BuildContext, E as PackageType, F as CopyOptionsFn, I as AttwOptions, M as DebugOptions, N as CopyEntry, O as RolldownContext, P as CopyOptions, S as ChunkAddonObject, T as OutExtensionObject, a as NoExternalFn, b as ChunkAddon, c as ResolvedConfig, d as UnusedOptions, f as UserConfig, g as ReportOptions, h as Workspace, i as InlineConfig, j as TsdownChunks, k as TsdownHooks, l as Sourcemap, m as UserConfigFn, n as DtsOptions, o as NormalizedFormat, p as UserConfigExport, r as Format, s as PublintOptions, t as CIOption, u as TreeshakingOptions, v as Logger, w as OutExtensionFactory, x as ChunkAddonFunction, y as globalLogger } from "./index-QuvuIHHG.mjs";
2
+ import { t as defineConfig } from "./config-BYPCbyiH.mjs";
3
3
 
4
4
  //#region src/index.d.ts
5
5
 
@@ -19,4 +19,4 @@ declare const shimFile: string;
19
19
  */
20
20
  declare function buildSingle(config: ResolvedConfig, clean: () => Promise<void>): Promise<(() => Promise<void>) | undefined>;
21
21
  //#endregion
22
- export { AttwOptions, BuildContext, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DebugOptions, DtsOptions, ExportsOptions, Format, InlineConfig, type Logger, NoExternalFn, NormalizedFormat, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageType, PublintOptions, ReportOptions, ResolvedConfig, RolldownContext, Sourcemap, TreeshakingOptions, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, Workspace, build, buildSingle, defineConfig, globalLogger, shimFile };
22
+ export { AttwOptions, BuildContext, CIOption, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DebugOptions, DtsOptions, ExportsOptions, Format, InlineConfig, type Logger, NoExternalFn, NormalizedFormat, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageType, PublintOptions, ReportOptions, ResolvedConfig, RolldownContext, Sourcemap, TreeshakingOptions, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigExport, UserConfigFn, Workspace, build, buildSingle, defineConfig, globalLogger, shimFile };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as defineConfig } from "./config-DLSWqKoz.mjs";
2
- import { n as buildSingle, r as shimFile, t as build } from "./src-DWFMRAyU.mjs";
3
- import { a as globalLogger } from "./package-Cu3WIzIc.mjs";
2
+ import { n as buildSingle, r as shimFile, t as build } from "./src-CBlanU1_.mjs";
3
+ import { a as globalLogger } from "./package-DMmUaSu9.mjs";
4
4
 
5
5
  export { build, buildSingle, defineConfig, globalLogger, shimFile };
@@ -1,4 +1,4 @@
1
- import { a as globalLogger, t as version } from "./package-Cu3WIzIc.mjs";
1
+ import { a as globalLogger, t as version } from "./package-DMmUaSu9.mjs";
2
2
  import process from "node:process";
3
3
  import { bold, green, underline } from "ansis";
4
4
  import { readFile, unlink, writeFile } from "node:fs/promises";
@@ -160,7 +160,7 @@ function hue2rgb(p, q, t) {
160
160
 
161
161
  //#endregion
162
162
  //#region package.json
163
- var version = "0.16.6";
163
+ var version = "0.16.7";
164
164
 
165
165
  //#endregion
166
166
  export { globalLogger as a, debounce as c, noop as d, pkgExists as f, toArray as g, slash as h, generateColor as i, importWithError as l, resolveRegex as m, LogLevels as n, prettyFormat as o, resolveComma as p, createLogger as r, prettyName as s, version as t, matchPattern as u };
@@ -1,4 +1,4 @@
1
- import { _ as Logger, g as ReportPlugin, s as ResolvedConfig } from "./index-BcO8yjl6.mjs";
1
+ import { _ as ReportPlugin, c as ResolvedConfig, v as Logger } from "./index-QuvuIHHG.mjs";
2
2
  import { Plugin } from "rolldown";
3
3
 
4
4
  //#region src/features/external.d.ts
package/dist/plugins.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./config-DLSWqKoz.mjs";
2
- import { a as ReportPlugin, i as ShebangPlugin, o as NodeProtocolPlugin, s as ExternalPlugin } from "./src-DWFMRAyU.mjs";
3
- import "./package-Cu3WIzIc.mjs";
2
+ import { a as ReportPlugin, i as ShebangPlugin, o as NodeProtocolPlugin, s as ExternalPlugin } from "./src-CBlanU1_.mjs";
3
+ import "./package-DMmUaSu9.mjs";
4
4
 
5
5
  export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin };
package/dist/run.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as globalLogger, g as toArray, p as resolveComma, t as version } from "./package-Cu3WIzIc.mjs";
2
+ import { a as globalLogger, g as toArray, p as resolveComma, t as version } from "./package-DMmUaSu9.mjs";
3
3
  import module from "node:module";
4
4
  import process from "node:process";
5
5
  import { dim } from "ansis";
@@ -36,7 +36,7 @@ cli.command("[...files]", "Bundle files", {
36
36
  await build$1(flags);
37
37
  });
38
38
  cli.command("migrate", "Migrate from tsup to tsdown").option("-c, --cwd <dir>", "Working directory").option("-d, --dry-run", "Dry run").action(async (args) => {
39
- const { migrate } = await import("./migrate-CFJaLDyD.mjs");
39
+ const { migrate } = await import("./migrate-D4tWVkLj.mjs");
40
40
  await migrate(args);
41
41
  });
42
42
  async function runCLI() {
@@ -1,9 +1,9 @@
1
1
  import { createRequire as __cjs_createRequire } from "node:module";
2
2
  const __cjs_require = __cjs_createRequire(import.meta.url);
3
- import { a as globalLogger, c as debounce, d as noop, f as pkgExists, g as toArray, h as slash, i as generateColor, l as importWithError, m as resolveRegex, n as LogLevels, o as prettyFormat, p as resolveComma, r as createLogger, s as prettyName, t as version, u as matchPattern } from "./package-Cu3WIzIc.mjs";
3
+ import { a as globalLogger, c as debounce, d as noop, f as pkgExists, g as toArray, h as slash, i as generateColor, l as importWithError, m as resolveRegex, n as LogLevels, o as prettyFormat, p as resolveComma, r as createLogger, s as prettyName, t as version, u as matchPattern } from "./package-DMmUaSu9.mjs";
4
4
  import { builtinModules, isBuiltin } from "node:module";
5
5
  import path, { dirname, join, normalize, sep } from "node:path";
6
- import process from "node:process";
6
+ import process, { env } from "node:process";
7
7
  import { fileURLToPath, pathToFileURL } from "node:url";
8
8
  import { blue, bold, dim, green, underline } from "ansis";
9
9
  import { VERSION, build } from "rolldown";
@@ -28,6 +28,12 @@ import { brotliCompress, gzip } from "node:zlib";
28
28
  import readline from "node:readline";
29
29
  import { globalContext, invalidateContextFile } from "rolldown-plugin-dts/tsc-context";
30
30
 
31
+ //#region node_modules/.pnpm/is-in-ci@2.0.0/node_modules/is-in-ci/index.js
32
+ const check = (key) => key in env && env[key] !== "0" && env[key] !== "false";
33
+ const isInCi = check("CI") || check("CONTINUOUS_INTEGRATION");
34
+ var is_in_ci_default = isInCi;
35
+
36
+ //#endregion
31
37
  //#region src/utils/fs.ts
32
38
  function fsExists(path$1) {
33
39
  return access(path$1).then(() => true, () => false);
@@ -155,10 +161,11 @@ async function loadConfigFile(inlineConfig, workspace) {
155
161
  ({config: exported, source: file} = result);
156
162
  globalLogger.info(`Using tsdown config: ${underline(file)}`);
157
163
  exported = await exported;
158
- if (typeof exported === "function") exported = await exported(inlineConfig);
164
+ if (typeof exported === "function") exported = await exported(inlineConfig, { ci: is_in_ci_default });
159
165
  }
160
166
  exported = toArray(exported);
161
167
  if (exported.length === 0) exported.push({});
168
+ if (exported.some((config) => typeof config === "function")) throw new Error("Function should not be nested within multiple tsdown configurations. It must be at the top level.\nExample: export default defineConfig(() => [...])");
162
169
  return {
163
170
  configs: exported,
164
171
  file
@@ -559,10 +566,10 @@ async function resolveWorkspace(config, inlineConfig) {
559
566
  };
560
567
  }
561
568
  async function resolveUserConfig(userConfig, inlineConfig) {
562
- let { entry, format = ["es"], plugins = [], clean = true, silent = false, logLevel = silent ? "silent" : "info", failOnWarn = false, customLogger, treeshake = true, platform = "node", outDir = "dist", sourcemap = false, dts, unused = false, watch = false, ignoreWatch, shims = false, skipNodeModulesBundle = false, publint: publint$1 = false, attw: attw$1 = false, fromVite, alias, tsconfig, report = true, target, env = {}, copy: copy$1, publicDir, hash, cwd = process.cwd(), name, workspace, external, noExternal, exports = false, bundle, unbundle = typeof bundle === "boolean" ? !bundle : false, removeNodeProtocol, nodeProtocol, cjsDefault = true, globImport = true, inlineOnly, fixedExtension = platform === "node", debug: debug$9 = false } = userConfig;
569
+ let { entry, format = ["es"], plugins = [], clean = true, silent = false, logLevel = silent ? "silent" : "info", failOnWarn = false, customLogger, treeshake = true, platform = "node", outDir = "dist", sourcemap = false, dts, unused = false, watch = false, ignoreWatch, shims = false, skipNodeModulesBundle = false, publint: publint$1 = false, attw: attw$1 = false, fromVite, alias, tsconfig, report = true, target, env: env$1 = {}, copy: copy$1, publicDir, hash = true, cwd = process.cwd(), name, workspace, external, noExternal, exports = false, bundle, unbundle = typeof bundle === "boolean" ? !bundle : false, removeNodeProtocol, nodeProtocol, cjsDefault = true, globImport = true, inlineOnly, fixedExtension = platform === "node", debug: debug$9 = false } = userConfig;
563
570
  const logger = createLogger(logLevel, {
564
571
  customLogger,
565
- failOnWarn
572
+ failOnWarn: resolveFeatureOption(failOnWarn, true)
566
573
  });
567
574
  if (typeof bundle === "boolean") logger.warn("`bundle` option is deprecated. Use `unbundle` instead.");
568
575
  if (removeNodeProtocol && nodeProtocol) throw new TypeError("`removeNodeProtocol` is deprecated. Please only use `nodeProtocol` instead.");
@@ -577,9 +584,12 @@ async function resolveUserConfig(userConfig, inlineConfig) {
577
584
  tsconfig = await resolveTsconfig(logger, tsconfig, cwd, name);
578
585
  if (typeof external === "string") external = resolveRegex(external);
579
586
  if (typeof noExternal === "string") noExternal = resolveRegex(noExternal);
580
- if (publint$1 === true) publint$1 = {};
581
- if (attw$1 === true) attw$1 = {};
582
- if (exports === true) exports = {};
587
+ publint$1 = resolveFeatureOption(publint$1, {});
588
+ attw$1 = resolveFeatureOption(attw$1, {});
589
+ exports = resolveFeatureOption(exports, {});
590
+ unused = resolveFeatureOption(unused, {});
591
+ report = resolveFeatureOption(report, {});
592
+ dts = resolveFeatureOption(dts, {});
583
593
  if (publicDir) if (copy$1) throw new TypeError("`publicDir` is deprecated. Cannot be used with `copy`");
584
594
  else logger.warn(`${blue`publicDir`} is deprecated. Use ${blue`copy`} instead.`);
585
595
  if (fromVite) {
@@ -604,10 +614,8 @@ async function resolveUserConfig(userConfig, inlineConfig) {
604
614
  noExternal = (id) => matchPattern(id, noExternalPatterns);
605
615
  }
606
616
  if (inlineOnly != null) inlineOnly = toArray(inlineOnly);
607
- if (debug$9) {
608
- if (debug$9 === true) debug$9 = {};
609
- debug$9.devtools ??= !!pkgExists("@vitejs/devtools/cli");
610
- }
617
+ debug$9 = resolveFeatureOption(debug$9, {});
618
+ if (debug$9) debug$9.devtools ??= !!pkgExists("@vitejs/devtools/cli");
611
619
  return {
612
620
  ...userConfig,
613
621
  entry,
@@ -620,8 +628,8 @@ async function resolveUserConfig(userConfig, inlineConfig) {
620
628
  treeshake,
621
629
  platform,
622
630
  sourcemap,
623
- dts: dts === true ? {} : dts,
624
- report: report === true ? {} : report,
631
+ dts,
632
+ report,
625
633
  unused,
626
634
  watch,
627
635
  ignoreWatch,
@@ -632,10 +640,10 @@ async function resolveUserConfig(userConfig, inlineConfig) {
632
640
  alias,
633
641
  tsconfig,
634
642
  cwd,
635
- env,
643
+ env: env$1,
636
644
  pkg,
637
645
  copy: publicDir || copy$1,
638
- hash: hash ?? true,
646
+ hash,
639
647
  name,
640
648
  external,
641
649
  noExternal,
@@ -656,6 +664,12 @@ async function mergeUserOptions(defaults, user, args) {
656
664
  ...userOutputOptions
657
665
  };
658
666
  }
667
+ function resolveFeatureOption(value, defaults) {
668
+ if (value === true) return defaults;
669
+ if (value === "ci-only") return is_in_ci_default ? defaults : false;
670
+ if (value === "local-only") return is_in_ci_default ? false : defaults;
671
+ return value;
672
+ }
659
673
 
660
674
  //#endregion
661
675
  //#region src/features/attw.ts
@@ -702,7 +716,7 @@ async function attw(options) {
702
716
  options.logger.warn("attw is enabled but package.json is not found");
703
717
  return;
704
718
  }
705
- const { profile = "strict", level = "warn", ...attwOptions } = options.attw === true ? {} : options.attw;
719
+ const { profile = "strict", level = "warn", ...attwOptions } = options.attw;
706
720
  const t = performance.now();
707
721
  debug$4("Running attw check");
708
722
  const tempDir = await mkdtemp(path.join(tmpdir(), "tsdown-attw-"));
@@ -798,7 +812,7 @@ async function publint(options) {
798
812
  const { publint: publint$1 } = await importWithError("publint");
799
813
  const { formatMessage } = await import("publint/utils");
800
814
  const { messages } = await publint$1({
801
- ...options.publint === true ? {} : options.publint,
815
+ ...options.publint,
802
816
  pkgDir: path.dirname(options.pkg.packageJsonPath)
803
817
  });
804
818
  debug$3("Found %d issues", messages.length);
@@ -1143,7 +1157,7 @@ async function getBuildOptions(config, format, isMultiFormat, cjsDts = false) {
1143
1157
  return rolldownConfig;
1144
1158
  }
1145
1159
  async function resolveInputOptions(config, format, cjsDts, isMultiFormat) {
1146
- const { entry, external, plugins: userPlugins, platform, alias, treeshake, dts, unused, target, shims, tsconfig, cwd, report, env, nodeProtocol, loader, name, logger, cjsDefault, banner, footer, globImport, debug: debug$9 } = config;
1160
+ const { entry, external, plugins: userPlugins, platform, alias, treeshake, dts, unused, target, shims, tsconfig, cwd, report, env: env$1, nodeProtocol, loader, name, logger, cjsDefault, banner, footer, globImport, debug: debug$9 } = config;
1147
1161
  const plugins = [];
1148
1162
  if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
1149
1163
  if (config.pkg || config.skipNodeModulesBundle) plugins.push(ExternalPlugin(config));
@@ -1167,7 +1181,7 @@ async function resolveInputOptions(config, format, cjsDts, isMultiFormat) {
1167
1181
  const { Unused } = await importWithError("unplugin-unused");
1168
1182
  plugins.push(Unused.rolldown({
1169
1183
  root: cwd,
1170
- ...unused === true ? {} : unused
1184
+ ...unused
1171
1185
  }));
1172
1186
  }
1173
1187
  if (target) plugins.push(await LightningCSSPlugin({ target }));
@@ -1178,8 +1192,8 @@ async function resolveInputOptions(config, format, cjsDts, isMultiFormat) {
1178
1192
  if (!cjsDts) plugins.push(userPlugins);
1179
1193
  const define = {
1180
1194
  ...config.define,
1181
- ...Object.keys(env).reduce((acc, key) => {
1182
- const value = JSON.stringify(env[key]);
1195
+ ...Object.keys(env$1).reduce((acc, key) => {
1196
+ const value = JSON.stringify(env$1[key]);
1183
1197
  acc[`process.env.${key}`] = value;
1184
1198
  acc[`import.meta.env.${key}`] = value;
1185
1199
  return acc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsdown",
3
- "version": "0.16.6",
3
+ "version": "0.16.7",
4
4
  "description": "The Elegant Bundler for Libraries",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "typesVersions": {
34
34
  "*": {
35
35
  "*": [
36
- "./dist/*",
36
+ "./dist/*.d.mts",
37
37
  "./*"
38
38
  ]
39
39
  }
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@arethetypeswrong/core": "^0.18.1",
49
- "@vitejs/devtools": "^0.0.0-alpha.17",
49
+ "@vitejs/devtools": "^0.0.0-alpha.18",
50
50
  "publint": "^0.3.0",
51
51
  "typescript": "^5.0.0",
52
52
  "unplugin-lightningcss": "^0.4.0",
@@ -79,9 +79,9 @@
79
79
  "diff": "^8.0.2",
80
80
  "empathic": "^2.0.0",
81
81
  "hookable": "^5.5.3",
82
- "obug": "^2.1.0",
82
+ "obug": "^2.1.1",
83
83
  "rolldown": "1.0.0-beta.51",
84
- "rolldown-plugin-dts": "^0.18.0",
84
+ "rolldown-plugin-dts": "^0.18.1",
85
85
  "semver": "^7.7.3",
86
86
  "tinyexec": "^1.0.2",
87
87
  "tinyglobby": "^0.2.15",
@@ -91,27 +91,28 @@
91
91
  },
92
92
  "devDependencies": {
93
93
  "@arethetypeswrong/core": "^0.18.2",
94
- "@sxzz/eslint-config": "^7.3.0",
94
+ "@sxzz/eslint-config": "^7.3.2",
95
95
  "@sxzz/prettier-config": "^2.2.5",
96
- "@sxzz/test-utils": "^0.5.12",
96
+ "@sxzz/test-utils": "^0.5.13",
97
97
  "@types/node": "^24.10.1",
98
98
  "@types/semver": "^7.7.1",
99
- "@unocss/eslint-plugin": "66.5.4",
100
- "@vitejs/devtools": "^0.0.0-alpha.17",
99
+ "@unocss/eslint-plugin": "^66.5.9",
100
+ "@vitejs/devtools": "^0.0.0-alpha.18",
101
101
  "@vueuse/core": "^14.0.0",
102
102
  "bumpp": "^10.3.1",
103
103
  "eslint": "^9.39.1",
104
+ "is-in-ci": "^2.0.0",
104
105
  "lightningcss": "^1.30.2",
105
106
  "pkg-types": "^2.3.0",
106
107
  "prettier": "^3.6.2",
107
108
  "publint": "^0.3.15",
108
109
  "rolldown-plugin-require-cjs": "^0.3.1",
109
110
  "typescript": "~5.9.3",
110
- "unocss": "^66.5.7",
111
+ "unocss": "^66.5.9",
111
112
  "unplugin-lightningcss": "^0.4.3",
112
113
  "unplugin-unused": "^0.5.6",
113
- "vite": "npm:rolldown-vite@^7.2.6",
114
- "vitest": "^4.0.10"
114
+ "vite": "npm:rolldown-vite@^7.2.7",
115
+ "vitest": "^4.0.14"
115
116
  },
116
117
  "engines": {
117
118
  "node": ">=20.19.0"