tsdown 0.4.0 → 0.4.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.
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { debug } from "./logger-Pk57TMWT.js";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { transform } from "oxc-transform";
|
|
4
3
|
|
|
5
4
|
//#region src/features/external.ts
|
|
6
5
|
function ExternalPlugin(pkg, skipNodeModulesBundle) {
|
|
@@ -26,18 +25,4 @@ function getProductionDeps(pkg) {
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
//#endregion
|
|
29
|
-
|
|
30
|
-
function SyntaxLoweringPlugin(target) {
|
|
31
|
-
return {
|
|
32
|
-
name: "tsdown:syntax-lowering",
|
|
33
|
-
renderChunk(code, chunk, { sourcemap }) {
|
|
34
|
-
return transform(chunk.fileName, code, {
|
|
35
|
-
sourcemap: !!sourcemap,
|
|
36
|
-
target
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
export { ExternalPlugin, SyntaxLoweringPlugin };
|
|
28
|
+
export { ExternalPlugin };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { debug, logger } from "./logger-Pk57TMWT.js";
|
|
2
|
-
import { ExternalPlugin
|
|
2
|
+
import { ExternalPlugin } from "./external-9r3oq3tH.js";
|
|
3
3
|
import process, { default as process$1, default as process$2, default as process$3 } from "node:process";
|
|
4
4
|
import { rolldown } from "rolldown";
|
|
5
|
+
import { transformPlugin } from "rolldown/experimental";
|
|
5
6
|
import { IsolatedDecl } from "unplugin-isolated-decl";
|
|
6
7
|
import { Unused } from "unplugin-unused";
|
|
7
8
|
import { access, readdir, rm, stat } from "node:fs/promises";
|
|
@@ -294,7 +295,7 @@ async function buildSingle(resolved) {
|
|
|
294
295
|
pkg && ExternalPlugin(pkg, resolved.skipNodeModulesBundle),
|
|
295
296
|
unused && Unused.rolldown(unused === true ? {} : unused),
|
|
296
297
|
dts && IsolatedDecl.rolldown(dts === true ? {} : dts),
|
|
297
|
-
target &&
|
|
298
|
+
target && transformPlugin({ target: typeof target === "string" ? target : target.join(",") }),
|
|
298
299
|
plugins
|
|
299
300
|
].filter((plugin) => !!plugin),
|
|
300
301
|
...resolved.inputOptions
|
package/dist/plugins.d.ts
CHANGED
package/dist/plugins.js
CHANGED
package/dist/run.js
CHANGED
|
@@ -5,13 +5,13 @@ import pc from "picocolors";
|
|
|
5
5
|
import { cac } from "cac";
|
|
6
6
|
|
|
7
7
|
//#region package.json
|
|
8
|
-
var version = "0.4.
|
|
8
|
+
var version = "0.4.2";
|
|
9
9
|
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/cli.ts
|
|
12
12
|
async function runCLI() {
|
|
13
13
|
const cli = cac("tsdown");
|
|
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("--platform <platform>", "Target platform", { default: "node" }).option("-w, --watch", "Watch mode").action(async (input, flags) => {
|
|
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("--platform <platform>", "Target platform", { default: "node" }).option("-w, --watch [path]", "Watch mode").action(async (input, flags) => {
|
|
15
15
|
if (!("CONSOLA_LEVEL" in process.env)) logger.level = flags.silent ? 0 : 3;
|
|
16
16
|
logger.info(`tsdown ${pc.dim(`v${version}`)} powered by rolldown ${pc.dim(`v${rolldownVersion}`)}`);
|
|
17
17
|
const { build } = await import("./index.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsdown",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "An even faster bundler powered by Rolldown.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,10 +43,9 @@
|
|
|
43
43
|
"chokidar": "^4.0.1",
|
|
44
44
|
"consola": "^3.2.3",
|
|
45
45
|
"debug": "^4.3.7",
|
|
46
|
-
"oxc-transform": "^0.38.0",
|
|
47
46
|
"picocolors": "^1.1.1",
|
|
48
47
|
"pkg-types": "^1.2.1",
|
|
49
|
-
"rolldown": "
|
|
48
|
+
"rolldown": "0.15.0-snapshot-993c4a1-20241205003858",
|
|
50
49
|
"tinyglobby": "^0.2.10",
|
|
51
50
|
"unconfig": "^0.6.0",
|
|
52
51
|
"unplugin-isolated-decl": "^0.9.3",
|
|
@@ -61,6 +60,7 @@
|
|
|
61
60
|
"eslint": "^9.16.0",
|
|
62
61
|
"execa": "^9.5.1",
|
|
63
62
|
"fdir": "^6.4.2",
|
|
63
|
+
"oxc-transform": "^0.39.0",
|
|
64
64
|
"prettier": "^3.4.2",
|
|
65
65
|
"tsup": "^8.3.5",
|
|
66
66
|
"tsx": "^4.19.2",
|