tsdown 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare const logger: ConsolaInstance;
|
|
|
15
15
|
/**
|
|
16
16
|
* Build with tsdown.
|
|
17
17
|
*/
|
|
18
|
-
declare function build(userOptions?:
|
|
18
|
+
declare function build(userOptions?: Options): Promise<void>;
|
|
19
19
|
declare const pkgRoot: string;
|
|
20
20
|
/**
|
|
21
21
|
* Build a single configuration, without watch and shortcuts features.
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineConfig } from "./config-0LDjKwZ7.js";
|
|
2
|
-
import { debug, logger } from "./logger-
|
|
2
|
+
import { debug, logger, setSilent } from "./logger-BV85twVD.js";
|
|
3
3
|
import { ExternalPlugin } from "./external-QIv-o_HK.js";
|
|
4
4
|
import path, { dirname, normalize, sep } from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
@@ -358,6 +358,7 @@ async function mergeUserOptions(defaults, user, args) {
|
|
|
358
358
|
//#endregion
|
|
359
359
|
//#region src/index.ts
|
|
360
360
|
async function build(userOptions = {}) {
|
|
361
|
+
typeof userOptions.silent === "boolean" && setSilent(userOptions.silent);
|
|
361
362
|
debug("Loading config");
|
|
362
363
|
const [resolveds, configFile] = await resolveOptions(userOptions);
|
|
363
364
|
if (configFile) debug("Loaded config:", configFile);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import process from "node:process";
|
|
1
2
|
import Debug from "debug";
|
|
2
3
|
import { consola } from "consola";
|
|
3
4
|
|
|
4
5
|
//#region src/utils/logger.ts
|
|
5
6
|
const logger = consola.withTag("tsdown");
|
|
6
7
|
const debug = Debug("tsdown");
|
|
8
|
+
function setSilent(silent) {
|
|
9
|
+
if (!("CONSOLA_LEVEL" in process.env)) logger.level = silent ? 0 : 3;
|
|
10
|
+
}
|
|
7
11
|
|
|
8
12
|
//#endregion
|
|
9
|
-
export { debug, logger };
|
|
13
|
+
export { debug, logger, setSilent };
|
package/dist/run.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { logger } from "./logger-
|
|
1
|
+
import { logger, setSilent } from "./logger-BV85twVD.js";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { VERSION } from "rolldown";
|
|
4
4
|
import pc from "picocolors";
|
|
5
5
|
import { cac } from "cac";
|
|
6
6
|
|
|
7
7
|
//#region package.json
|
|
8
|
-
var version = "0.5.
|
|
8
|
+
var version = "0.5.5";
|
|
9
9
|
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/cli.ts
|
|
12
12
|
async function runCLI() {
|
|
13
13
|
const cli = cac("tsdown");
|
|
14
14
|
cli.command("[...files]", "Bundle files", { ignoreOptionDefaultValue: true }).option("-c, --config <filename>", "Use a custom config file").option("--no-config", "Disable config file").option("--format <format>", "Bundle format: esm, cjs, iife", { default: "esm" }).option("--clean", "Clean output directory").option("--minify", "Minify output").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("--silent", "Suppress non-error logs").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("-w, --watch [path]", "Watch mode").action(async (input, flags) => {
|
|
15
|
-
|
|
15
|
+
setSilent(!!flags.silent);
|
|
16
16
|
logger.info(`tsdown ${pc.dim(`v${version}`)} powered by rolldown ${pc.dim(`v${VERSION}`)}`);
|
|
17
17
|
const { build: build$1 } = await import("./index.js");
|
|
18
18
|
if (input.length > 0) flags.entry = input;
|