tsdown 0.2.16 → 0.2.17
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.js +31 -18
- package/dist/run.js +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -198,7 +198,16 @@ async function loadConfigFile(options) {
|
|
|
198
198
|
extensions: []
|
|
199
199
|
}] : [{
|
|
200
200
|
files: "tsdown.config",
|
|
201
|
-
extensions: [
|
|
201
|
+
extensions: [
|
|
202
|
+
"ts",
|
|
203
|
+
"mts",
|
|
204
|
+
"cts",
|
|
205
|
+
"js",
|
|
206
|
+
"mjs",
|
|
207
|
+
"cjs",
|
|
208
|
+
"json",
|
|
209
|
+
""
|
|
210
|
+
]
|
|
202
211
|
}, {
|
|
203
212
|
files: "package.json",
|
|
204
213
|
extensions: [],
|
|
@@ -220,25 +229,28 @@ async function build(userOptions = {}) {
|
|
|
220
229
|
const { entry, external, plugins, outDir, format, clean, platform, alias, treeshake, sourcemap, dts, minify, watch, unused } = resolved;
|
|
221
230
|
if (clean) await cleanOutDir(outDir, clean);
|
|
222
231
|
const pkg = await readPackageJson(process.cwd());
|
|
223
|
-
let startTime
|
|
224
|
-
|
|
225
|
-
input: entry,
|
|
226
|
-
external,
|
|
227
|
-
resolve: { alias },
|
|
228
|
-
treeshake,
|
|
229
|
-
platform,
|
|
230
|
-
plugins: [ExternalPlugin(pkg, platform), dts && IsolatedDecl.rolldown(dts === true ? {} : dts), unused && Unused.rolldown(unused === true ? {} : unused), ...plugins].filter((plugin) => !!plugin),
|
|
231
|
-
...resolved.inputOptions
|
|
232
|
-
};
|
|
233
|
-
const build$1 = await rolldown(inputOptions);
|
|
234
|
-
await writeBundle(true);
|
|
232
|
+
let startTime;
|
|
233
|
+
await rebuild(true);
|
|
235
234
|
if (watch) {
|
|
236
|
-
await watchBuild(resolved,
|
|
237
|
-
} else {
|
|
238
|
-
await build$1.close();
|
|
235
|
+
await watchBuild(resolved, rebuild);
|
|
239
236
|
}
|
|
240
|
-
async function
|
|
241
|
-
|
|
237
|
+
async function rebuild(first) {
|
|
238
|
+
startTime = performance.now();
|
|
239
|
+
const inputOptions = {
|
|
240
|
+
input: entry,
|
|
241
|
+
external,
|
|
242
|
+
resolve: { alias },
|
|
243
|
+
treeshake,
|
|
244
|
+
platform,
|
|
245
|
+
plugins: [
|
|
246
|
+
ExternalPlugin(pkg, platform),
|
|
247
|
+
dts && IsolatedDecl.rolldown(dts === true ? {} : dts),
|
|
248
|
+
unused && Unused.rolldown(unused === true ? {} : unused),
|
|
249
|
+
...plugins
|
|
250
|
+
].filter((plugin) => !!plugin),
|
|
251
|
+
...resolved.inputOptions
|
|
252
|
+
};
|
|
253
|
+
const build$1 = await rolldown(inputOptions);
|
|
242
254
|
await Promise.all(format.map(async (format$1) => {
|
|
243
255
|
const extension = resolveOutputExtension(pkg, format$1);
|
|
244
256
|
const outputOptions = {
|
|
@@ -255,6 +267,7 @@ async function build(userOptions = {}) {
|
|
|
255
267
|
...userOutputOptions
|
|
256
268
|
});
|
|
257
269
|
}));
|
|
270
|
+
await build$1.close();
|
|
258
271
|
logger.success(`${first ? "Build" : "Rebuild"} complete in ${Math.round(performance.now() - startTime)}ms`);
|
|
259
272
|
}
|
|
260
273
|
}
|
package/dist/run.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsdown",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
4
4
|
"description": "An even faster bundler powered by Rolldown.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,26 +40,26 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"cac": "^6.7.14",
|
|
43
|
-
"chokidar": "^4.0.
|
|
43
|
+
"chokidar": "^4.0.1",
|
|
44
44
|
"consola": "^3.2.3",
|
|
45
45
|
"picocolors": "^1.1.0",
|
|
46
46
|
"pkg-types": "^1.2.0",
|
|
47
47
|
"rolldown": "nightly",
|
|
48
48
|
"tinyglobby": "^0.2.6",
|
|
49
|
-
"unconfig": "^0.
|
|
50
|
-
"unplugin-isolated-decl": "^0.6.
|
|
49
|
+
"unconfig": "^0.6.0",
|
|
50
|
+
"unplugin-isolated-decl": "^0.6.5",
|
|
51
51
|
"unplugin-unused": "^0.2.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@sxzz/eslint-config": "^4.2.0",
|
|
55
55
|
"@sxzz/prettier-config": "^2.0.2",
|
|
56
|
-
"@types/node": "^22.
|
|
57
|
-
"bumpp": "^9.
|
|
58
|
-
"eslint": "^9.
|
|
59
|
-
"execa": "^9.
|
|
56
|
+
"@types/node": "^22.7.4",
|
|
57
|
+
"bumpp": "^9.6.1",
|
|
58
|
+
"eslint": "^9.11.1",
|
|
59
|
+
"execa": "^9.4.0",
|
|
60
60
|
"fdir": "^6.3.0",
|
|
61
61
|
"prettier": "^3.3.3",
|
|
62
|
-
"tsup": "^8.
|
|
62
|
+
"tsup": "^8.3.0",
|
|
63
63
|
"tsx": "^4.19.1",
|
|
64
64
|
"typescript": "~5.6.2",
|
|
65
65
|
"vitest": "^2.1.1"
|