tsdown 0.15.0 → 0.15.2
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/{config-Dk5Fszoy.d.mts → config-Bm-9Qi9v.d.mts} +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{migrate-Di69B4rp.mjs → migrate-D3HWK6xC.mjs} +1 -1
- package/dist/package-13Z93fyS.mjs +5 -0
- package/dist/plugins.d.mts +1 -1
- package/dist/plugins.mjs +1 -1
- package/dist/run.d.mts +1 -1
- package/dist/run.mjs +3 -3
- package/dist/{src-DecVfDJY.mjs → src-CJAG-MXu.mjs} +36 -40
- package/dist/{types-CrxW0Y6g.d.mts → types-CDDBvUh8.d.mts} +22 -4
- package/package.json +7 -7
- package/dist/package-BCet0jau.mjs +0 -5
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { UserConfig, UserConfigFn } from "./types-
|
|
2
|
-
import { defineConfig } from "./config-
|
|
1
|
+
import { UserConfig, UserConfigFn } from "./types-CDDBvUh8.mjs";
|
|
2
|
+
import { defineConfig } from "./config-Bm-9Qi9v.mjs";
|
|
3
3
|
export { UserConfig, UserConfigFn, defineConfig };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AttwOptions, BuildContext, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DtsOptions, ExportsOptions, Format, Logger, ModuleTypes, NormalizedFormat, NormalizedUserConfig, Options, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageType, PublintOptions, ReportOptions, ResolvedOptions, RolldownContext, Sourcemap, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigFn, Workspace, globalLogger } from "./types-
|
|
2
|
-
import { defineConfig } from "./config-
|
|
1
|
+
import { AttwOptions, BuildContext, ChunkAddon, ChunkAddonFunction, ChunkAddonObject, CopyEntry, CopyOptions, CopyOptionsFn, DtsOptions, ExportsOptions, Format, Logger, ModuleTypes, NormalizedFormat, NormalizedUserConfig, Options, OutExtensionContext, OutExtensionFactory, OutExtensionObject, PackageType, PublintOptions, ReportOptions, ResolvedOptions, RolldownContext, Sourcemap, TsdownChunks, TsdownHooks, UnusedOptions, UserConfig, UserConfigFn, Workspace, globalLogger } from "./types-CDDBvUh8.mjs";
|
|
2
|
+
import { defineConfig } from "./config-Bm-9Qi9v.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/index.d.ts
|
|
5
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "./config-CCGWF4al.mjs";
|
|
2
|
-
import { build, buildSingle, shimFile } from "./src-
|
|
2
|
+
import { build, buildSingle, shimFile } from "./src-CJAG-MXu.mjs";
|
|
3
3
|
import { globalLogger } from "./logger-C09npKHT.mjs";
|
|
4
4
|
|
|
5
5
|
export { build, buildSingle, defineConfig, globalLogger, shimFile };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { globalLogger } from "./logger-C09npKHT.mjs";
|
|
2
|
-
import { version } from "./package-
|
|
2
|
+
import { version } from "./package-13Z93fyS.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { bold, green, underline } from "ansis";
|
|
5
5
|
import { readFile, unlink, writeFile } from "node:fs/promises";
|
package/dist/plugins.d.mts
CHANGED
package/dist/plugins.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./config-CCGWF4al.mjs";
|
|
2
|
-
import { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin } from "./src-
|
|
2
|
+
import { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin } from "./src-CJAG-MXu.mjs";
|
|
3
3
|
import "./logger-C09npKHT.mjs";
|
|
4
4
|
|
|
5
5
|
export { ExternalPlugin, NodeProtocolPlugin, ReportPlugin, ShebangPlugin };
|
package/dist/run.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { };
|
package/dist/run.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { globalLogger, resolveComma, toArray } from "./logger-C09npKHT.mjs";
|
|
3
|
-
import { version } from "./package-
|
|
3
|
+
import { version } from "./package-13Z93fyS.mjs";
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { dim } from "ansis";
|
|
@@ -14,7 +14,7 @@ cli.help().version(version);
|
|
|
14
14
|
cli.command("[...files]", "Bundle files", {
|
|
15
15
|
ignoreOptionDefaultValue: true,
|
|
16
16
|
allowUnknownOptions: true
|
|
17
|
-
}).option("-c, --config <filename>", "Use a custom config file").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("--external <module>", "Mark dependencies as external").option("--minify", "Minify output").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("-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("--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("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter workspace packages, e.g. /regex/ or substring").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
17
|
+
}).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, unconfig", { 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("--external <module>", "Mark dependencies as external").option("--minify", "Minify output").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("-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("--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("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter workspace packages, e.g. /regex/ or substring").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
18
18
|
globalLogger.level = flags.logLevel || (flags.silent ? "silent" : "info");
|
|
19
19
|
globalLogger.info(`tsdown ${dim`v${version}`} powered by rolldown ${dim`v${VERSION}`}`);
|
|
20
20
|
const { build: build$1 } = await import("./index.mjs");
|
|
@@ -22,7 +22,7 @@ cli.command("[...files]", "Bundle files", {
|
|
|
22
22
|
await build$1(flags);
|
|
23
23
|
});
|
|
24
24
|
cli.command("migrate", "Migrate from tsup to tsdown").option("-c, --cwd <dir>", "Working directory").option("-d, --dry-run", "Dry run").action(async (args) => {
|
|
25
|
-
const { migrate } = await import("./migrate-
|
|
25
|
+
const { migrate } = await import("./migrate-D3HWK6xC.mjs");
|
|
26
26
|
await migrate(args);
|
|
27
27
|
});
|
|
28
28
|
async function runCLI() {
|
|
@@ -429,31 +429,6 @@ function resolvePackageTarget(pkg) {
|
|
|
429
429
|
if (nodeMinVersion.version === "0.0.0") return;
|
|
430
430
|
return `node${nodeMinVersion.version}`;
|
|
431
431
|
}
|
|
432
|
-
let warned = false;
|
|
433
|
-
function RuntimeHelperCheckPlugin(logger, targets) {
|
|
434
|
-
return {
|
|
435
|
-
name: "tsdown:runtime-helper-check",
|
|
436
|
-
resolveId: {
|
|
437
|
-
filter: { id: /^@oxc-project\/runtime/ },
|
|
438
|
-
async handler(id, ...args) {
|
|
439
|
-
const EXTERNAL = {
|
|
440
|
-
id,
|
|
441
|
-
external: true
|
|
442
|
-
};
|
|
443
|
-
if (warned) return EXTERNAL;
|
|
444
|
-
const resolved = await this.resolve(id, ...args);
|
|
445
|
-
if (!resolved) {
|
|
446
|
-
if (!warned) {
|
|
447
|
-
warned = true;
|
|
448
|
-
logger.warn(`The target environment (${targets.join(", ")}) requires runtime helpers from ${blue`@oxc-project/runtime`}. Please install it to ensure all necessary polyfills are included.\nFor more information, visit: https://tsdown.dev/options/target#runtime-helpers`);
|
|
449
|
-
}
|
|
450
|
-
return EXTERNAL;
|
|
451
|
-
}
|
|
452
|
-
return resolved;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
432
|
|
|
458
433
|
//#endregion
|
|
459
434
|
//#region src/features/tsconfig.ts
|
|
@@ -561,7 +536,11 @@ async function loadConfigFile(options, workspace) {
|
|
|
561
536
|
} else if (stats.isDirectory()) cwd = resolved;
|
|
562
537
|
}
|
|
563
538
|
}
|
|
564
|
-
|
|
539
|
+
let isNative = false;
|
|
540
|
+
if (!loaded) {
|
|
541
|
+
if (!options.configLoader || options.configLoader === "auto") isNative = !!(process.features.typescript || process.versions.bun || process.versions.deno);
|
|
542
|
+
else if (options.configLoader === "native") isNative = true;
|
|
543
|
+
}
|
|
565
544
|
let { config, sources } = await loadConfig.async({
|
|
566
545
|
sources: overrideConfig ? [{
|
|
567
546
|
files: filePath,
|
|
@@ -578,10 +557,7 @@ async function loadConfigFile(options, workspace) {
|
|
|
578
557
|
"json",
|
|
579
558
|
""
|
|
580
559
|
],
|
|
581
|
-
parser:
|
|
582
|
-
const mod = await import(pathToFileURL(filepath).href);
|
|
583
|
-
return mod.default || mod;
|
|
584
|
-
}
|
|
560
|
+
parser: isNative ? nativeImport : "auto"
|
|
585
561
|
}, {
|
|
586
562
|
files: "package.json",
|
|
587
563
|
extensions: [],
|
|
@@ -601,6 +577,16 @@ async function loadConfigFile(options, workspace) {
|
|
|
601
577
|
file
|
|
602
578
|
};
|
|
603
579
|
}
|
|
580
|
+
async function nativeImport(id) {
|
|
581
|
+
const mod = await import(pathToFileURL(id).href).catch((error) => {
|
|
582
|
+
if (error?.message?.includes?.("Cannot find module")) {
|
|
583
|
+
const configError = /* @__PURE__ */ new Error(`Failed to load the config file. Try setting the --config-loader CLI flag to \`unconfig\`.\n\n${error.message}`);
|
|
584
|
+
configError.cause = error;
|
|
585
|
+
throw configError;
|
|
586
|
+
} else throw error;
|
|
587
|
+
});
|
|
588
|
+
return mod.default || mod;
|
|
589
|
+
}
|
|
604
590
|
|
|
605
591
|
//#endregion
|
|
606
592
|
//#region src/options/index.ts
|
|
@@ -688,7 +674,7 @@ async function resolveWorkspace(config, options) {
|
|
|
688
674
|
};
|
|
689
675
|
}
|
|
690
676
|
async function resolveConfig(userConfig) {
|
|
691
|
-
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 } = userConfig;
|
|
677
|
+
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 } = userConfig;
|
|
692
678
|
const logger = createLogger(logLevel, {
|
|
693
679
|
customLogger,
|
|
694
680
|
failOnWarn
|
|
@@ -759,7 +745,8 @@ async function resolveConfig(userConfig) {
|
|
|
759
745
|
exports,
|
|
760
746
|
unbundle,
|
|
761
747
|
nodeProtocol,
|
|
762
|
-
cjsDefault
|
|
748
|
+
cjsDefault,
|
|
749
|
+
globImport
|
|
763
750
|
};
|
|
764
751
|
}
|
|
765
752
|
async function mergeUserOptions(defaults, user, args) {
|
|
@@ -923,20 +910,25 @@ function resolveChunkFilename({ outExtensions, fixedExtension, pkg, hash }, inpu
|
|
|
923
910
|
jsExtension = js;
|
|
924
911
|
dtsExtension = dts;
|
|
925
912
|
}
|
|
926
|
-
jsExtension
|
|
913
|
+
jsExtension ??= `.${resolveJsOutputExtension(packageType, format, fixedExtension)}`;
|
|
927
914
|
const suffix = format === "iife" || format === "umd" ? `.${format}` : "";
|
|
928
915
|
return [createChunkFilename(`[name]${suffix}`, jsExtension, dtsExtension), createChunkFilename(`[name]${suffix}${hash ? "-[hash]" : ""}`, jsExtension, dtsExtension)];
|
|
929
916
|
}
|
|
930
917
|
function createChunkFilename(basename, jsExtension, dtsExtension) {
|
|
931
|
-
if (
|
|
918
|
+
if (dtsExtension === void 0) return `${basename}${jsExtension}`;
|
|
932
919
|
return (chunk) => {
|
|
933
920
|
return `${basename}${chunk.name.endsWith(".d") ? dtsExtension : jsExtension}`;
|
|
934
921
|
};
|
|
935
922
|
}
|
|
936
|
-
function resolveChunkAddon(chunkAddon, format) {
|
|
923
|
+
function resolveChunkAddon(chunkAddon, format, dts) {
|
|
937
924
|
if (!chunkAddon) return;
|
|
938
925
|
return (chunk) => {
|
|
939
|
-
if (
|
|
926
|
+
if (!dts && RE_DTS.test(chunk.fileName)) return "";
|
|
927
|
+
if (typeof chunkAddon === "function") chunkAddon = chunkAddon({
|
|
928
|
+
format,
|
|
929
|
+
fileName: chunk.fileName
|
|
930
|
+
});
|
|
931
|
+
if (typeof chunkAddon === "string") return chunkAddon;
|
|
940
932
|
switch (true) {
|
|
941
933
|
case RE_JS.test(chunk.fileName): return chunkAddon?.js || "";
|
|
942
934
|
case RE_CSS.test(chunk.fileName): return chunkAddon?.css || "";
|
|
@@ -1067,7 +1059,7 @@ async function getBuildOptions(config, format, isMultiFormat, cjsDts = false) {
|
|
|
1067
1059
|
return rolldownConfig;
|
|
1068
1060
|
}
|
|
1069
1061
|
async function resolveInputOptions(config, format, cjsDts, isMultiFormat) {
|
|
1070
|
-
const { entry, external, plugins: userPlugins, platform, alias, treeshake, dts, unused, target, define, shims, tsconfig, cwd, report, env, nodeProtocol, loader, name, logger, cjsDefault } = config;
|
|
1062
|
+
const { entry, external, plugins: userPlugins, platform, alias, treeshake, dts, unused, target, define, shims, tsconfig, cwd, report, env, nodeProtocol, loader, name, logger, cjsDefault, banner, footer, globImport } = config;
|
|
1071
1063
|
const plugins = [];
|
|
1072
1064
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
1073
1065
|
if (config.pkg || config.skipNodeModulesBundle) plugins.push(ExternalPlugin(config));
|
|
@@ -1075,6 +1067,8 @@ async function resolveInputOptions(config, format, cjsDts, isMultiFormat) {
|
|
|
1075
1067
|
const { dts: dtsPlugin } = await import("rolldown-plugin-dts");
|
|
1076
1068
|
const options = {
|
|
1077
1069
|
tsconfig,
|
|
1070
|
+
banner: resolveChunkAddon(banner, format, true),
|
|
1071
|
+
footer: resolveChunkAddon(footer, format, true),
|
|
1078
1072
|
...dts
|
|
1079
1073
|
};
|
|
1080
1074
|
if (format === "es") plugins.push(dtsPlugin(options));
|
|
@@ -1089,8 +1083,9 @@ async function resolveInputOptions(config, format, cjsDts, isMultiFormat) {
|
|
|
1089
1083
|
const { Unused } = await import("unplugin-unused");
|
|
1090
1084
|
plugins.push(Unused.rolldown(unused === true ? {} : unused));
|
|
1091
1085
|
}
|
|
1092
|
-
if (target) plugins.push(
|
|
1093
|
-
plugins.push(ShebangPlugin(logger, cwd, name, isMultiFormat)
|
|
1086
|
+
if (target) plugins.push(await LightningCSSPlugin({ target }));
|
|
1087
|
+
plugins.push(ShebangPlugin(logger, cwd, name, isMultiFormat));
|
|
1088
|
+
if (globImport) plugins.push(importGlobPlugin());
|
|
1094
1089
|
}
|
|
1095
1090
|
if (report && LogLevels[logger.level] >= 3) plugins.push(ReportPlugin(report, logger, cwd, cjsDts, name, isMultiFormat));
|
|
1096
1091
|
if (!cjsDts) plugins.push(userPlugins);
|
|
@@ -1118,7 +1113,8 @@ async function resolveInputOptions(config, format, cjsDts, isMultiFormat) {
|
|
|
1118
1113
|
onLog: cjsDefault ? (level, log, defaultHandler) => {
|
|
1119
1114
|
if (log.code === "MIXED_EXPORT") return;
|
|
1120
1115
|
defaultHandler(level, log);
|
|
1121
|
-
} : void 0
|
|
1116
|
+
} : void 0,
|
|
1117
|
+
experimental: { resolveNewUrlToAsset: true }
|
|
1122
1118
|
}, config.inputOptions, [format, { cjsDts }]);
|
|
1123
1119
|
}
|
|
1124
1120
|
async function resolveOutputOptions(inputOptions, config, format, cjsDts) {
|
|
@@ -120,8 +120,9 @@ interface ChunkAddonObject {
|
|
|
120
120
|
}
|
|
121
121
|
type ChunkAddonFunction = (ctx: {
|
|
122
122
|
format: Format;
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
fileName: string;
|
|
124
|
+
}) => ChunkAddonObject | string | undefined;
|
|
125
|
+
type ChunkAddon = ChunkAddonObject | ChunkAddonFunction | string;
|
|
125
126
|
//#endregion
|
|
126
127
|
//#region src/utils/logger.d.ts
|
|
127
128
|
type LogType = "error" | "warn" | "info";
|
|
@@ -291,6 +292,9 @@ interface Options {
|
|
|
291
292
|
*/
|
|
292
293
|
nodeProtocol?: "strip" | boolean;
|
|
293
294
|
plugins?: InputOptions["plugins"];
|
|
295
|
+
/**
|
|
296
|
+
* Use with caution; ensure you understand the implications.
|
|
297
|
+
*/
|
|
294
298
|
inputOptions?: InputOptions | ((options: InputOptions, format: NormalizedFormat, context: {
|
|
295
299
|
cjsDts: boolean;
|
|
296
300
|
}) => Awaitable<InputOptions | void | null>);
|
|
@@ -346,6 +350,9 @@ interface Options {
|
|
|
346
350
|
* @default true
|
|
347
351
|
*/
|
|
348
352
|
cjsDefault?: boolean;
|
|
353
|
+
/**
|
|
354
|
+
* Use with caution; ensure you understand the implications.
|
|
355
|
+
*/
|
|
349
356
|
outputOptions?: OutputOptions | ((options: OutputOptions, format: NormalizedFormat, context: {
|
|
350
357
|
cjsDts: boolean;
|
|
351
358
|
}) => Awaitable<OutputOptions | void | null>);
|
|
@@ -385,6 +392,11 @@ interface Options {
|
|
|
385
392
|
*/
|
|
386
393
|
config?: boolean | string;
|
|
387
394
|
/**
|
|
395
|
+
* Config loader to use. It can only be set via CLI or API.
|
|
396
|
+
* @default 'auto'
|
|
397
|
+
*/
|
|
398
|
+
configLoader?: "auto" | "native" | "unconfig";
|
|
399
|
+
/**
|
|
388
400
|
* Reuse config from Vite or Vitest (experimental)
|
|
389
401
|
* @default false
|
|
390
402
|
*/
|
|
@@ -432,6 +444,12 @@ interface Options {
|
|
|
432
444
|
*/
|
|
433
445
|
report?: boolean | ReportOptions;
|
|
434
446
|
/**
|
|
447
|
+
* `import.meta.glob` support.
|
|
448
|
+
* @see https://vite.dev/guide/features.html#glob-import
|
|
449
|
+
* @default true
|
|
450
|
+
*/
|
|
451
|
+
globImport?: boolean;
|
|
452
|
+
/**
|
|
435
453
|
* **[experimental]** Generate package exports for `package.json`.
|
|
436
454
|
*
|
|
437
455
|
* This will set the `main`, `module`, `types`, `exports` fields in `package.json`
|
|
@@ -467,10 +485,10 @@ interface Options {
|
|
|
467
485
|
/**
|
|
468
486
|
* Options without specifying config file path.
|
|
469
487
|
*/
|
|
470
|
-
type UserConfig = Arrayable<Omit<Options, "config" | "filter">>;
|
|
488
|
+
type UserConfig = Arrayable<Omit<Options, "config" | "filter" | "configLoader">>;
|
|
471
489
|
type UserConfigFn = (cliOptions: Options) => Awaitable<UserConfig>;
|
|
472
490
|
type NormalizedUserConfig = Exclude<UserConfig, any[]>;
|
|
473
|
-
type ResolvedOptions = Omit<Overwrite<MarkPartial<Omit<Options, "publicDir" | "workspace" | "filter" | "silent" | "logLevel" | "failOnWarn" | "customLogger">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "external" | "noExternal" | "onSuccess" | "fixedExtension" | "outExtensions" | "hooks" | "removeNodeProtocol" | "copy" | "loader" | "name" | "bundle" | "banner" | "footer">, {
|
|
491
|
+
type ResolvedOptions = Omit<Overwrite<MarkPartial<Omit<Options, "publicDir" | "workspace" | "filter" | "silent" | "logLevel" | "failOnWarn" | "customLogger" | "configLoader">, "globalName" | "inputOptions" | "outputOptions" | "minify" | "define" | "alias" | "external" | "noExternal" | "onSuccess" | "fixedExtension" | "outExtensions" | "hooks" | "removeNodeProtocol" | "copy" | "loader" | "name" | "bundle" | "banner" | "footer">, {
|
|
474
492
|
format: NormalizedFormat[];
|
|
475
493
|
target?: string[];
|
|
476
494
|
clean: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsdown",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "The Elegant Bundler for Libraries",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"ansis": "^4.1.0",
|
|
73
73
|
"cac": "^6.7.14",
|
|
74
74
|
"chokidar": "^4.0.3",
|
|
75
|
-
"debug": "^4.4.
|
|
75
|
+
"debug": "^4.4.3",
|
|
76
76
|
"diff": "^8.0.2",
|
|
77
77
|
"empathic": "^2.0.0",
|
|
78
78
|
"hookable": "^5.5.3",
|
|
79
79
|
"rolldown": "latest",
|
|
80
|
-
"rolldown-plugin-dts": "^0.16.
|
|
80
|
+
"rolldown-plugin-dts": "^0.16.5",
|
|
81
81
|
"semver": "^7.7.2",
|
|
82
82
|
"tinyexec": "^1.0.1",
|
|
83
83
|
"tinyglobby": "^0.2.15",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"@arethetypeswrong/core": "^0.18.2",
|
|
89
89
|
"@sxzz/eslint-config": "^7.1.4",
|
|
90
90
|
"@sxzz/prettier-config": "^2.2.4",
|
|
91
|
-
"@sxzz/test-utils": "^0.5.
|
|
91
|
+
"@sxzz/test-utils": "^0.5.11",
|
|
92
92
|
"@types/debug": "^4.1.12",
|
|
93
|
-
"@types/node": "^24.
|
|
93
|
+
"@types/node": "^24.5.0",
|
|
94
94
|
"@types/semver": "^7.7.1",
|
|
95
95
|
"@unocss/eslint-plugin": "^66.5.1",
|
|
96
96
|
"@vueuse/core": "^13.9.0",
|
|
@@ -103,8 +103,8 @@
|
|
|
103
103
|
"tsx": "^4.20.5",
|
|
104
104
|
"typescript": "~5.9.2",
|
|
105
105
|
"unocss": "^66.5.1",
|
|
106
|
-
"unplugin-lightningcss": "^0.4.
|
|
107
|
-
"unplugin-unused": "^0.5.
|
|
106
|
+
"unplugin-lightningcss": "^0.4.3",
|
|
107
|
+
"unplugin-unused": "^0.5.3",
|
|
108
108
|
"vite": "npm:rolldown-vite@latest",
|
|
109
109
|
"vitest": "^3.2.4"
|
|
110
110
|
},
|