rolldown 1.1.5 → 1.2.0
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/cli.mjs +6 -6
- package/dist/config.d.mts +16 -17
- package/dist/config.mjs +2 -2
- package/dist/experimental-index.d.mts +164 -155
- package/dist/experimental-index.mjs +23 -14
- package/dist/experimental-runtime-types.d.ts +111 -41
- package/dist/filter-index.d.mts +6 -5
- package/dist/get-log-filter.d.mts +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.mts +3 -4
- package/dist/parse-ast-index.d.mts +19 -20
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/plugins-index.d.mts +27 -28
- package/dist/plugins-index.mjs +2 -2
- package/dist/shared/{binding-D26QphWG.d.mts → binding-Dbbi0RbO.d.mts} +37 -25
- package/dist/shared/{binding-TuFFIE_J.mjs → binding-Dby9rwGk.mjs} +26 -26
- package/dist/shared/{bindingify-input-options-XPJLJOD0.mjs → bindingify-input-options-_ppP73I9.mjs} +5 -5
- package/dist/shared/{constructors-BbWPse2X.d.mts → constructors-CSWbNgBZ.d.mts} +9 -10
- package/dist/shared/{constructors-D_3i7dpX.mjs → constructors-CuGa75s-.mjs} +1 -1
- package/dist/shared/define-config-B-IDOhDz.d.mts +4003 -0
- package/dist/shared/{error-BHRSI0R7.mjs → error-DFGNOCle.mjs} +1 -1
- package/dist/shared/get-log-filter-AjBknEEO.d.mts +34 -0
- package/dist/shared/{load-config-BL_FI6dc.mjs → load-config-C6UyiS41.mjs} +1 -1
- package/dist/shared/{logging-BSNejiLS.d.mts → logging-xuHO4mAy.d.mts} +6 -6
- package/dist/shared/{normalize-string-or-regex-dnh67V_w.mjs → normalize-string-or-regex-SiXbePVH.mjs} +1 -1
- package/dist/shared/{parse-D4dtlfWy.mjs → parse-BFj5G_7i.mjs} +2 -2
- package/dist/shared/{resolve-tsconfig-DxqIJB3x.mjs → resolve-tsconfig-2TXRF_zr.mjs} +2 -2
- package/dist/shared/{rolldown-ChpIlMRm.mjs → rolldown-951h_1lf.mjs} +1 -1
- package/dist/shared/{rolldown-build-CtPvmZgJ.mjs → rolldown-build-CdF8HAHX.mjs} +4 -4
- package/dist/shared/transform-Cs2bUDRH.d.mts +148 -0
- package/dist/shared/{watch-B1b0gmVh.mjs → watch-WnrlHRS0.mjs} +4 -4
- package/dist/utils-index.d.mts +29 -30
- package/dist/utils-index.mjs +5 -5
- package/package.json +21 -21
- package/dist/shared/define-config-BhJ90aEv.d.mts +0 -3978
- package/dist/shared/get-log-filter-BpNVNJ5-.d.mts +0 -35
- package/dist/shared/transform-BPrUvqEZ.d.mts +0 -149
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
2
|
-
import { S as version, x as description } from "./shared/bindingify-input-options-
|
|
1
|
+
import { n as onExit, t as watch } from "./shared/watch-WnrlHRS0.mjs";
|
|
2
|
+
import { S as version, x as description } from "./shared/bindingify-input-options-_ppP73I9.mjs";
|
|
3
3
|
import { t as arraify } from "./shared/misc-CoQm4NHO.mjs";
|
|
4
|
-
import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-
|
|
5
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
6
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
4
|
+
import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-CdF8HAHX.mjs";
|
|
5
|
+
import { t as rolldown } from "./shared/rolldown-951h_1lf.mjs";
|
|
6
|
+
import { t as loadConfig } from "./shared/load-config-C6UyiS41.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import g$1 from "node:process";
|
|
9
9
|
import { performance } from "node:perf_hooks";
|
|
@@ -862,7 +862,7 @@ function getClearScreenFunction(options) {
|
|
|
862
862
|
};
|
|
863
863
|
}
|
|
864
864
|
//#endregion
|
|
865
|
-
//#region \0@oxc-project+runtime@0.
|
|
865
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/usingCtx.js
|
|
866
866
|
function _usingCtx() {
|
|
867
867
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
868
868
|
var n = Error();
|
package/dist/config.d.mts
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { L as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-
|
|
2
|
-
|
|
1
|
+
import { L as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-B-IDOhDz.mjs";
|
|
3
2
|
//#region src/utils/load-config.d.ts
|
|
4
3
|
type ConfigLoader = "bundle" | "native";
|
|
5
4
|
interface LoadConfigOptions {
|
|
6
5
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
* How to load the config file.
|
|
7
|
+
* - `'bundle'` (default): bundle the config with Rolldown, then import it.
|
|
8
|
+
* - `'native'`: import the config directly, delegating TypeScript/loader
|
|
9
|
+
* handling to the runtime. Faster, but requires runtime support.
|
|
10
|
+
*
|
|
11
|
+
* @default 'bundle'
|
|
12
|
+
*/
|
|
14
13
|
configLoader?: ConfigLoader;
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
17
|
-
* Load config from a file in a way that Rolldown does.
|
|
18
|
-
*
|
|
19
|
-
* @param configPath The path to the config file. If empty, it will look for `rolldown.config` with supported extensions in the current working directory.
|
|
20
|
-
* @param options Loading options. `configLoader` selects `'bundle'` (default) or `'native'`.
|
|
21
|
-
* @returns The loaded config export
|
|
22
|
-
*
|
|
23
|
-
* @category Config
|
|
24
|
-
*/
|
|
16
|
+
* Load config from a file in a way that Rolldown does.
|
|
17
|
+
*
|
|
18
|
+
* @param configPath The path to the config file. If empty, it will look for `rolldown.config` with supported extensions in the current working directory.
|
|
19
|
+
* @param options Loading options. `configLoader` selects `'bundle'` (default) or `'native'`.
|
|
20
|
+
* @returns The loaded config export
|
|
21
|
+
*
|
|
22
|
+
* @category Config
|
|
23
|
+
*/
|
|
25
24
|
declare function loadConfig(configPath: string, options?: LoadConfigOptions): Promise<ConfigExport>;
|
|
26
25
|
//#endregion
|
|
27
26
|
export { VERSION, defineConfig, loadConfig };
|
package/dist/config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as VERSION } from "./shared/bindingify-input-options-
|
|
1
|
+
import { b as VERSION } from "./shared/bindingify-input-options-_ppP73I9.mjs";
|
|
2
2
|
import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
|
|
3
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
3
|
+
import { t as loadConfig } from "./shared/load-config-C6UyiS41.mjs";
|
|
4
4
|
export { VERSION, defineConfig, loadConfig };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Bt as OutputOptions, F as BuiltinPlugin, Q as defineParallelPlugin, Wt as StringOrRegExp, Yt as RolldownOutput, Zt as freeExternalMemory, l as InputOptions, lt as NormalizedOutputOptions } from "./shared/define-config-
|
|
3
|
-
import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-
|
|
4
|
-
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-
|
|
5
|
-
|
|
1
|
+
import { H as ResolverFactory, J as moduleRunnerTransform, K as isolatedDeclaration, L as NapiResolveOptions, M as IsolatedDeclarationsOptions, N as IsolatedDeclarationsResult, V as ResolveResult, _ as BindingTsconfigCompilerOptions, i as BindingClientHmrUpdate, k as BindingViteTransformPluginConfig, n as BindingBundleAnalyzerPluginConfig, p as BindingRebuildStrategy, q as isolatedDeclarationSync, r as BindingBundleState, u as BindingLazyChunkOutput, v as BindingTsconfigRawOptions, w as BindingViteManifestPluginConfig } from "./shared/binding-Dbbi0RbO.mjs";
|
|
2
|
+
import { Bt as OutputOptions, F as BuiltinPlugin, Q as defineParallelPlugin, Wt as StringOrRegExp, Yt as RolldownOutput, Zt as freeExternalMemory, l as InputOptions, lt as NormalizedOutputOptions } from "./shared/define-config-B-IDOhDz.mjs";
|
|
3
|
+
import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-Cs2bUDRH.mjs";
|
|
4
|
+
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-CSWbNgBZ.mjs";
|
|
6
5
|
//#region src/api/dev/dev-options.d.ts
|
|
7
6
|
type DevOnHmrUpdates = (result: Error | {
|
|
8
7
|
updates: BindingClientHmrUpdate[];
|
|
@@ -12,80 +11,81 @@ type DevOnOutput = (result: Error | RolldownOutput) => void | Promise<void>;
|
|
|
12
11
|
type DevOnAdditionalAssets = (output: RolldownOutput) => void | Promise<void>;
|
|
13
12
|
interface DevWatchOptions {
|
|
14
13
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
* If `true`, files are not written to disk.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
18
17
|
skipWrite?: boolean;
|
|
19
18
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
* If `true`, use polling instead of native file system events for watching.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
23
22
|
usePolling?: boolean;
|
|
24
23
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
* Poll interval in milliseconds (only used when usePolling is true).
|
|
25
|
+
* @default 100
|
|
26
|
+
*/
|
|
28
27
|
pollInterval?: number;
|
|
29
28
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
* If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
33
32
|
useDebounce?: boolean;
|
|
34
33
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
* Debounce duration in milliseconds (only used when useDebounce is true).
|
|
35
|
+
* @default 10
|
|
36
|
+
*/
|
|
38
37
|
debounceDuration?: number;
|
|
39
38
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
* Whether to compare file contents for poll-based watchers (only used when usePolling is true).
|
|
40
|
+
* When enabled, poll watchers will check file contents to determine if they actually changed.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
44
43
|
compareContentsForPolling?: boolean;
|
|
45
44
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
* Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
|
|
46
|
+
* Controls how frequently the debouncer checks for events to process.
|
|
47
|
+
* When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
|
|
48
|
+
* @default undefined (auto-select)
|
|
49
|
+
*/
|
|
51
50
|
debounceTickRate?: number;
|
|
52
51
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
* Filter to limit which discovered files are registered with the file watcher.
|
|
53
|
+
*
|
|
54
|
+
* Strings are treated as glob patterns.
|
|
55
|
+
*
|
|
56
|
+
* @default []
|
|
57
|
+
*/
|
|
59
58
|
include?: StringOrRegExp | StringOrRegExp[];
|
|
60
59
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
* Filter to prevent discovered files from being registered with the file watcher.
|
|
61
|
+
*
|
|
62
|
+
* Strings are treated as glob patterns.
|
|
63
|
+
*
|
|
64
|
+
* @default []
|
|
65
|
+
*/
|
|
67
66
|
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
68
67
|
}
|
|
69
68
|
interface DevOptions {
|
|
70
69
|
onHmrUpdates?: DevOnHmrUpdates;
|
|
71
70
|
onOutput?: DevOnOutput;
|
|
72
71
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
* Called with assets emitted while generating an HMR patch or compiling a
|
|
73
|
+
* lazy entry (e.g. an image newly imported by the changed/lazy module).
|
|
74
|
+
*
|
|
75
|
+
* These never go through {@link onOutput}, so a consumer that serves built
|
|
76
|
+
* files (e.g. Vite's bundled dev server) must register this to receive them
|
|
77
|
+
* and write them to its in-memory file store before the client requests them.
|
|
78
|
+
*/
|
|
80
79
|
onAdditionalAssets?: DevOnAdditionalAssets;
|
|
81
80
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
* Strategy for triggering rebuilds after HMR updates.
|
|
82
|
+
* - `'always'`: Always trigger a rebuild after HMR updates
|
|
83
|
+
* - `'never'`: Never trigger rebuild after HMR updates. The server no longer
|
|
84
|
+
* decides full reloads, so there is no `'auto'` upgrade anymore; pull fresh
|
|
85
|
+
* bundle output explicitly (e.g. `ensureLatestBuildOutput`) when needed.
|
|
86
|
+
* @default 'never'
|
|
87
|
+
*/
|
|
88
|
+
rebuildStrategy?: "always" | "never";
|
|
89
89
|
watch?: DevWatchOptions;
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
@@ -99,22 +99,31 @@ declare class DevEngine {
|
|
|
99
99
|
getBundleState(): Promise<BindingBundleState>;
|
|
100
100
|
ensureLatestBuildOutput(): Promise<void>;
|
|
101
101
|
triggerFullBuild(): void;
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Client-connect signal (the clientId hello): creates the per-client session
|
|
104
|
+
* with an empty ship map. Reconnects arrive as fresh clientIds.
|
|
105
|
+
*/
|
|
106
|
+
registerClient(clientId: string): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* Delivery notification from the serving middleware: the response for
|
|
109
|
+
* `filename` completed, so record its modules as shipped to that client.
|
|
110
|
+
*/
|
|
111
|
+
notifyPayloadDelivered(filename: string): Promise<void>;
|
|
104
112
|
removeClient(clientId: string): Promise<void>;
|
|
105
113
|
close(): Promise<void>;
|
|
106
114
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
* Compile a lazy entry module and return HMR-style patch code.
|
|
116
|
+
*
|
|
117
|
+
* This is called when a dynamically imported module is first requested at runtime.
|
|
118
|
+
* The module was previously stubbed with a proxy, and now we need to compile the
|
|
119
|
+
* actual module and its dependencies.
|
|
120
|
+
*
|
|
121
|
+
* @param moduleId - The absolute file path of the module to compile
|
|
122
|
+
* @param clientId - The client ID requesting this compilation
|
|
123
|
+
* @returns The compiled chunk: its code plus the filename whose delivery the
|
|
124
|
+
* serving middleware reports via {@link notifyPayloadDelivered}
|
|
125
|
+
*/
|
|
126
|
+
compileEntry(moduleId: string, clientId: string): Promise<BindingLazyChunkOutput>;
|
|
118
127
|
}
|
|
119
128
|
//#endregion
|
|
120
129
|
//#region src/api/dev/index.d.ts
|
|
@@ -122,20 +131,20 @@ declare const dev: typeof DevEngine.create;
|
|
|
122
131
|
//#endregion
|
|
123
132
|
//#region src/api/experimental.d.ts
|
|
124
133
|
/**
|
|
125
|
-
* This is an experimental API. Its behavior may change in the future.
|
|
126
|
-
*
|
|
127
|
-
* - Calling this API will only execute the `scan/build` stage of rolldown.
|
|
128
|
-
* - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
|
|
129
|
-
*
|
|
130
|
-
* @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
|
|
131
|
-
* ```ts
|
|
132
|
-
* import { scan } from 'rolldown/api/experimental';
|
|
133
|
-
*
|
|
134
|
-
* const cleanupPromise = await scan(...);
|
|
135
|
-
* await cleanupPromise;
|
|
136
|
-
* // Now all resources have been cleaned up.
|
|
137
|
-
* ```
|
|
138
|
-
*/
|
|
134
|
+
* This is an experimental API. Its behavior may change in the future.
|
|
135
|
+
*
|
|
136
|
+
* - Calling this API will only execute the `scan/build` stage of rolldown.
|
|
137
|
+
* - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
|
|
138
|
+
*
|
|
139
|
+
* @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
|
|
140
|
+
* ```ts
|
|
141
|
+
* import { scan } from 'rolldown/api/experimental';
|
|
142
|
+
*
|
|
143
|
+
* const cleanupPromise = await scan(...);
|
|
144
|
+
* await cleanupPromise;
|
|
145
|
+
* // Now all resources have been cleaned up.
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
139
148
|
declare const scan: (rawInputOptions: InputOptions, rawOutputOptions?: {}) => Promise<Promise<void>>;
|
|
140
149
|
//#endregion
|
|
141
150
|
//#region src/builtin-plugin/alias-plugin.d.ts
|
|
@@ -149,53 +158,53 @@ declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
|
|
|
149
158
|
//#endregion
|
|
150
159
|
//#region src/builtin-plugin/bundle-analyzer-plugin.d.ts
|
|
151
160
|
/**
|
|
152
|
-
* A plugin that analyzes bundle composition and generates detailed reports.
|
|
153
|
-
*
|
|
154
|
-
* The plugin outputs a file containing detailed information about:
|
|
155
|
-
* - All chunks and their relationships
|
|
156
|
-
* - Modules bundled in each chunk
|
|
157
|
-
* - Import dependencies between chunks
|
|
158
|
-
* - Reachable modules from each entry point
|
|
159
|
-
*
|
|
160
|
-
* @example
|
|
161
|
-
* ```js
|
|
162
|
-
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
163
|
-
*
|
|
164
|
-
* export default {
|
|
165
|
-
* plugins: [
|
|
166
|
-
* bundleAnalyzerPlugin()
|
|
167
|
-
* ]
|
|
168
|
-
* }
|
|
169
|
-
* ```
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* **Custom filename**
|
|
173
|
-
* ```js
|
|
174
|
-
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
175
|
-
*
|
|
176
|
-
* export default {
|
|
177
|
-
* plugins: [
|
|
178
|
-
* bundleAnalyzerPlugin({
|
|
179
|
-
* fileName: 'bundle-analysis.json'
|
|
180
|
-
* })
|
|
181
|
-
* ]
|
|
182
|
-
* }
|
|
183
|
-
* ```
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* **LLM-friendly markdown output**
|
|
187
|
-
* ```js
|
|
188
|
-
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
189
|
-
*
|
|
190
|
-
* export default {
|
|
191
|
-
* plugins: [
|
|
192
|
-
* bundleAnalyzerPlugin({
|
|
193
|
-
* format: 'md'
|
|
194
|
-
* })
|
|
195
|
-
* ]
|
|
196
|
-
* }
|
|
197
|
-
* ```
|
|
198
|
-
*/
|
|
161
|
+
* A plugin that analyzes bundle composition and generates detailed reports.
|
|
162
|
+
*
|
|
163
|
+
* The plugin outputs a file containing detailed information about:
|
|
164
|
+
* - All chunks and their relationships
|
|
165
|
+
* - Modules bundled in each chunk
|
|
166
|
+
* - Import dependencies between chunks
|
|
167
|
+
* - Reachable modules from each entry point
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```js
|
|
171
|
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
172
|
+
*
|
|
173
|
+
* export default {
|
|
174
|
+
* plugins: [
|
|
175
|
+
* bundleAnalyzerPlugin()
|
|
176
|
+
* ]
|
|
177
|
+
* }
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* **Custom filename**
|
|
182
|
+
* ```js
|
|
183
|
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
184
|
+
*
|
|
185
|
+
* export default {
|
|
186
|
+
* plugins: [
|
|
187
|
+
* bundleAnalyzerPlugin({
|
|
188
|
+
* fileName: 'bundle-analysis.json'
|
|
189
|
+
* })
|
|
190
|
+
* ]
|
|
191
|
+
* }
|
|
192
|
+
* ```
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* **LLM-friendly markdown output**
|
|
196
|
+
* ```js
|
|
197
|
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
198
|
+
*
|
|
199
|
+
* export default {
|
|
200
|
+
* plugins: [
|
|
201
|
+
* bundleAnalyzerPlugin({
|
|
202
|
+
* format: 'md'
|
|
203
|
+
* })
|
|
204
|
+
* ]
|
|
205
|
+
* }
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
199
208
|
declare function bundleAnalyzerPlugin(config?: BindingBundleAnalyzerPluginConfig): BuiltinPlugin;
|
|
200
209
|
//#endregion
|
|
201
210
|
//#region src/builtin-plugin/transform-plugin.d.ts
|
|
@@ -216,32 +225,32 @@ declare function viteManifestPlugin(config: ViteManifestPluginConfig): BuiltinPl
|
|
|
216
225
|
//#endregion
|
|
217
226
|
//#region src/experimental-index.d.ts
|
|
218
227
|
/**
|
|
219
|
-
* In-memory file system for browser builds.
|
|
220
|
-
*
|
|
221
|
-
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
|
|
222
|
-
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
|
|
223
|
-
*
|
|
224
|
-
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
|
|
225
|
-
* - `volume`: The underlying `Volume` instance that stores the filesystem state
|
|
226
|
-
*
|
|
227
|
-
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
|
|
228
|
-
*
|
|
229
|
-
* @example
|
|
230
|
-
* ```typescript
|
|
231
|
-
* import { memfs } from 'rolldown/experimental';
|
|
232
|
-
*
|
|
233
|
-
* // Write files to virtual filesystem before bundling
|
|
234
|
-
* memfs?.volume.fromJSON({
|
|
235
|
-
* '/src/index.js': 'export const foo = 42;',
|
|
236
|
-
* '/package.json': '{"name": "my-app"}'
|
|
237
|
-
* });
|
|
238
|
-
*
|
|
239
|
-
* // Read files from the virtual filesystem
|
|
240
|
-
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
|
|
241
|
-
* ```
|
|
242
|
-
*
|
|
243
|
-
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
|
|
244
|
-
*/
|
|
228
|
+
* In-memory file system for browser builds.
|
|
229
|
+
*
|
|
230
|
+
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
|
|
231
|
+
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
|
|
232
|
+
*
|
|
233
|
+
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
|
|
234
|
+
* - `volume`: The underlying `Volume` instance that stores the filesystem state
|
|
235
|
+
*
|
|
236
|
+
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* ```typescript
|
|
240
|
+
* import { memfs } from 'rolldown/experimental';
|
|
241
|
+
*
|
|
242
|
+
* // Write files to virtual filesystem before bundling
|
|
243
|
+
* memfs?.volume.fromJSON({
|
|
244
|
+
* '/src/index.js': 'export const foo = 42;',
|
|
245
|
+
* '/package.json': '{"name": "my-app"}'
|
|
246
|
+
* });
|
|
247
|
+
*
|
|
248
|
+
* // Read files from the virtual filesystem
|
|
249
|
+
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
|
|
250
|
+
* ```
|
|
251
|
+
*
|
|
252
|
+
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
|
|
253
|
+
*/
|
|
245
254
|
declare const memfs: {
|
|
246
255
|
fs: any;
|
|
247
256
|
volume: any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-
|
|
3
|
-
import { o as transformToRollupOutput } from "./shared/bindingify-input-options-
|
|
4
|
-
import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-
|
|
5
|
-
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-
|
|
6
|
-
import { n as parseSync$1, t as parse$1 } from "./shared/parse-
|
|
7
|
-
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-
|
|
8
|
-
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-Dby9rwGk.mjs";
|
|
2
|
+
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-SiXbePVH.mjs";
|
|
3
|
+
import { o as transformToRollupOutput } from "./shared/bindingify-input-options-_ppP73I9.mjs";
|
|
4
|
+
import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-CdF8HAHX.mjs";
|
|
5
|
+
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-DFGNOCle.mjs";
|
|
6
|
+
import { n as parseSync$1, t as parse$1 } from "./shared/parse-BFj5G_7i.mjs";
|
|
7
|
+
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-CuGa75s-.mjs";
|
|
8
|
+
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-2TXRF_zr.mjs";
|
|
9
9
|
import { pathToFileURL } from "node:url";
|
|
10
10
|
//#region src/api/dev/dev-engine.ts
|
|
11
11
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
@@ -44,7 +44,7 @@ var DevEngine = class DevEngine {
|
|
|
44
44
|
onAdditionalAssets: userOnAdditionalAssets ? function(output) {
|
|
45
45
|
userOnAdditionalAssets(transformToRollupOutput(output));
|
|
46
46
|
} : void 0,
|
|
47
|
-
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? import_binding.BindingRebuildStrategy.Always :
|
|
47
|
+
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? import_binding.BindingRebuildStrategy.Always : import_binding.BindingRebuildStrategy.Never : void 0,
|
|
48
48
|
watch: devOptions.watch && {
|
|
49
49
|
skipWrite: devOptions.watch.skipWrite,
|
|
50
50
|
usePolling: devOptions.watch.usePolling,
|
|
@@ -83,11 +83,19 @@ var DevEngine = class DevEngine {
|
|
|
83
83
|
triggerFullBuild() {
|
|
84
84
|
this.#inner.triggerFullBuild();
|
|
85
85
|
}
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Client-connect signal (the clientId hello): creates the per-client session
|
|
88
|
+
* with an empty ship map. Reconnects arrive as fresh clientIds.
|
|
89
|
+
*/
|
|
90
|
+
async registerClient(clientId) {
|
|
91
|
+
await this.#inner.registerClient(clientId);
|
|
88
92
|
}
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Delivery notification from the serving middleware: the response for
|
|
95
|
+
* `filename` completed, so record its modules as shipped to that client.
|
|
96
|
+
*/
|
|
97
|
+
async notifyPayloadDelivered(filename) {
|
|
98
|
+
await this.#inner.notifyPayloadDelivered(filename);
|
|
91
99
|
}
|
|
92
100
|
async removeClient(clientId) {
|
|
93
101
|
await this.#inner.removeClient(clientId);
|
|
@@ -104,7 +112,8 @@ var DevEngine = class DevEngine {
|
|
|
104
112
|
*
|
|
105
113
|
* @param moduleId - The absolute file path of the module to compile
|
|
106
114
|
* @param clientId - The client ID requesting this compilation
|
|
107
|
-
* @returns The compiled
|
|
115
|
+
* @returns The compiled chunk: its code plus the filename whose delivery the
|
|
116
|
+
* serving middleware reports via {@link notifyPayloadDelivered}
|
|
108
117
|
*/
|
|
109
118
|
async compileEntry(moduleId, clientId) {
|
|
110
119
|
return this.#inner.compileEntry(moduleId, clientId);
|