robuild 0.0.5 → 0.0.7
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/README.md +208 -41
- package/dist/_chunks/build-5gEwHBbl.mjs +2251 -0
- package/dist/_chunks/config-CeOzkcue.d.mts +492 -0
- package/dist/_chunks/package-DIjirV4E.mjs +83 -0
- package/dist/cli.mjs +142 -12
- package/dist/config.d.mts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +8 -2
- package/dist/_chunks/build-eIjZ3Fk8.mjs +0 -388
- package/dist/_chunks/config-DxLkhDt6.d.mts +0 -99
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { ResolveOptions } from "exsolve";
|
|
2
|
-
import { InputOptions, MinifyOptions, OutputOptions, RolldownBuild, RolldownPluginOption } from "rolldown";
|
|
3
|
-
import { Options } from "rolldown-plugin-dts";
|
|
4
|
-
import { MinifyOptions as MinifyOptions$1 } from "oxc-minify";
|
|
5
|
-
import { TransformOptions } from "oxc-transform";
|
|
6
|
-
|
|
7
|
-
//#region src/types.d.ts
|
|
8
|
-
interface BuildContext {
|
|
9
|
-
pkgDir: string;
|
|
10
|
-
pkg: {
|
|
11
|
-
name: string;
|
|
12
|
-
} & Record<string, unknown>;
|
|
13
|
-
}
|
|
14
|
-
interface _BuildEntry {
|
|
15
|
-
/**
|
|
16
|
-
* Output directory relative to project root.
|
|
17
|
-
*
|
|
18
|
-
* Defaults to `dist/` if not provided.
|
|
19
|
-
*/
|
|
20
|
-
outDir?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Avoid actual build but instead link to the source files.
|
|
23
|
-
*/
|
|
24
|
-
stub?: boolean;
|
|
25
|
-
}
|
|
26
|
-
type BundleEntry = _BuildEntry & {
|
|
27
|
-
type: "bundle";
|
|
28
|
-
/**
|
|
29
|
-
* Entry point(s) to bundle relative to the project root.
|
|
30
|
-
*/
|
|
31
|
-
input: string | string[];
|
|
32
|
-
/**
|
|
33
|
-
* Minify the output using rolldown.
|
|
34
|
-
*
|
|
35
|
-
* Defaults to `false` if not provided.
|
|
36
|
-
*/
|
|
37
|
-
minify?: boolean | "dce-only" | MinifyOptions;
|
|
38
|
-
/**
|
|
39
|
-
* Options passed to rolldown.
|
|
40
|
-
*
|
|
41
|
-
* See [rolldown config options](https://rolldown.rs/reference/config-options) for more details.
|
|
42
|
-
*/
|
|
43
|
-
rolldown?: InputOptions & {
|
|
44
|
-
plugins?: RolldownPluginOption[];
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Declaration generation options.
|
|
48
|
-
*
|
|
49
|
-
* See [rolldown-plugin-dts](https://github.com/sxzz/rolldown-plugin-dts) for more details.
|
|
50
|
-
*
|
|
51
|
-
* Options are inferred from the `tsconfig.json` file if available.
|
|
52
|
-
*
|
|
53
|
-
* Set to `false` to disable.
|
|
54
|
-
*/
|
|
55
|
-
dts?: boolean | Options;
|
|
56
|
-
};
|
|
57
|
-
type TransformEntry = _BuildEntry & {
|
|
58
|
-
type: "transform";
|
|
59
|
-
/**
|
|
60
|
-
* Directory to transform relative to the project root.
|
|
61
|
-
*/
|
|
62
|
-
input: string;
|
|
63
|
-
/**
|
|
64
|
-
* Minify the output using oxc-minify.
|
|
65
|
-
*
|
|
66
|
-
* Defaults to `false` if not provided.
|
|
67
|
-
*/
|
|
68
|
-
minify?: boolean | MinifyOptions$1;
|
|
69
|
-
/**
|
|
70
|
-
* Options passed to oxc-transform.
|
|
71
|
-
*
|
|
72
|
-
* See [oxc-transform](https://www.npmjs.com/package/oxc-transform) for more details.
|
|
73
|
-
*/
|
|
74
|
-
oxc?: TransformOptions;
|
|
75
|
-
/**
|
|
76
|
-
* Options passed to exsolve for module resolution.
|
|
77
|
-
*
|
|
78
|
-
* See [exsolve](https://github.com/unjs/exsolve) for more details.
|
|
79
|
-
*/
|
|
80
|
-
resolve?: Omit<ResolveOptions, "from">;
|
|
81
|
-
};
|
|
82
|
-
type BuildEntry = BundleEntry | TransformEntry;
|
|
83
|
-
interface BuildHooks {
|
|
84
|
-
start?: (ctx: BuildContext) => void | Promise<void>;
|
|
85
|
-
end?: (ctx: BuildContext) => void | Promise<void>;
|
|
86
|
-
entries?: (entries: BuildEntry[], ctx: BuildContext) => void | Promise<void>;
|
|
87
|
-
rolldownConfig?: (cfg: InputOptions, ctx: BuildContext) => void | Promise<void>;
|
|
88
|
-
rolldownOutput?: (cfg: OutputOptions, res: RolldownBuild, ctx: BuildContext) => void | Promise<void>;
|
|
89
|
-
}
|
|
90
|
-
interface BuildConfig {
|
|
91
|
-
cwd?: string | URL;
|
|
92
|
-
entries?: (BuildEntry | string)[];
|
|
93
|
-
hooks?: BuildHooks;
|
|
94
|
-
}
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/config.d.ts
|
|
97
|
-
declare function defineConfig(config: BuildConfig): BuildConfig;
|
|
98
|
-
//#endregion
|
|
99
|
-
export { BuildConfig, BuildEntry, BundleEntry, TransformEntry, defineConfig };
|