@theholocron/tsdown-config 8.9.0-alpha.1 → 8.9.0-alpha.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/index.js +1 -1
- package/dist/presets/library.d.ts +4 -0
- package/dist/presets/library.js +1 -36
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -12,6 +12,10 @@ import { UserConfig } from "tsdown";
|
|
|
12
12
|
* before final emit -- fragile (a future import could reach code that
|
|
13
13
|
* doesn't shake away) and slow (~15s vs sub-second for a properly
|
|
14
14
|
* externalized build).
|
|
15
|
+
*
|
|
16
|
+
* After every successful build, `onSuccess` fails it if an emitted bundle is
|
|
17
|
+
* over 500KB -- the symptom of a dependency that failed to externalize
|
|
18
|
+
* (holocron#762). A caller's own `onSuccess` (function or shell command) runs after the check.
|
|
15
19
|
*/
|
|
16
20
|
export declare function library(options?: UserConfig): UserConfig;
|
|
17
21
|
/** Ready-to-use config for packages that need no customisation. */
|
package/dist/presets/library.js
CHANGED
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineConfig } from "tsdown";
|
|
3
|
-
// presets/library.ts
|
|
4
|
-
/**
|
|
5
|
-
* tsdown preset for a published ESM library.
|
|
6
|
-
* Single entry point, generates types, externalizes every dependency.
|
|
7
|
-
*
|
|
8
|
-
* `neverBundle: true` externalizes every bare-specifier import, not just
|
|
9
|
-
* `@theholocron/*` peers -- the narrower regex this used to carry only
|
|
10
|
-
* ever protected org packages, so a package with real third-party runtime
|
|
11
|
-
* deps (e.g. google-client's googleapis/google-auth-library) got them
|
|
12
|
-
* bundled by default. Confirmed harmless there today only because
|
|
13
|
-
* rolldown's tree-shaking happened to strip the unreachable code back out
|
|
14
|
-
* before final emit -- fragile (a future import could reach code that
|
|
15
|
-
* doesn't shake away) and slow (~15s vs sub-second for a properly
|
|
16
|
-
* externalized build).
|
|
17
|
-
*/
|
|
18
|
-
function library(options = {}) {
|
|
19
|
-
const merged = {
|
|
20
|
-
entry: ["src/index.ts"],
|
|
21
|
-
outDir: "dist",
|
|
22
|
-
format: "esm",
|
|
23
|
-
dts: true,
|
|
24
|
-
clean: true,
|
|
25
|
-
deps: { neverBundle: true },
|
|
26
|
-
...options
|
|
27
|
-
};
|
|
28
|
-
return defineConfig({
|
|
29
|
-
...merged,
|
|
30
|
-
entry: resolveEntry(merged.entry),
|
|
31
|
-
outDir: resolveOutDir(merged.outDir ?? "dist")
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
/** Ready-to-use config for packages that need no customisation. */
|
|
35
|
-
var library_default = library();
|
|
36
|
-
export { library_default as default, library };
|
|
1
|
+
export { n as default, t as library } from "../library-CsBMxOb0.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/tsdown-config",
|
|
3
|
-
"version": "8.9.0-alpha.
|
|
3
|
+
"version": "8.9.0-alpha.2",
|
|
4
4
|
"description": "Shared tsdown configurations for @theholocron packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tsdown",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"tsdown": "^0.23.3",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
48
|
"vitest": "^5.0.5",
|
|
49
|
-
"@theholocron/
|
|
50
|
-
"@theholocron/
|
|
49
|
+
"@theholocron/vitest-config": "8.9.0-alpha.2",
|
|
50
|
+
"@theholocron/tsconfig": "8.9.0-alpha.2"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"tsdown": "^0"
|