rolldown 0.15.0-snapshot-5e456b6-20241203003703 → 0.15.0-snapshot-993c4a1-20241205003858
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/cjs/cli.cjs +164 -151
- package/dist/cjs/experimental-index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +1 -1
- package/dist/esm/cli.mjs +165 -152
- package/dist/esm/experimental-index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/{consola_36c0034f-DWsVjwtA.mjs → consola_36c0034f--bn5jvdH.mjs} +1 -1
- package/dist/shared/consola_36c0034f-_8_dG1Nr.cjs +1 -1
- package/dist/shared/{prompt-DGW8ZJmn.mjs → prompt-DHyJur3_.mjs} +2 -2
- package/dist/shared/{prompt-RFvZMmjc.cjs → prompt-DkiZzbTg.cjs} +1 -1
- package/dist/shared/{src-COU7qQBJ.cjs → src-BIbmsUlX.cjs} +100 -75
- package/dist/shared/{src-DEPa5yhI.mjs → src-qgo__dKA.mjs} +100 -75
- package/dist/types/api/build.d.ts +2 -0
- package/dist/types/api/watch/index.d.ts +2 -2
- package/dist/types/api/watch/watch-emitter.d.ts +31 -0
- package/dist/types/api/watch/watcher.d.ts +6 -26
- package/dist/types/binding.d.ts +12 -8
- package/dist/types/cli/arguments/schema.d.ts +6 -6
- package/dist/types/index.d.ts +3 -3
- package/dist/types/options/input-options-schema.d.ts +16 -16
- package/dist/types/options/input-options.d.ts +1 -0
- package/dist/types/rollup.d.ts +4 -0
- package/dist/types/treeshake/module-side-effects.d.ts +8 -8
- package/dist/types/types/rolldown-output.d.ts +4 -0
- package/dist/types/utils/error.d.ts +1 -1
- package/package.json +14 -14
|
@@ -188,10 +188,12 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
|
|
|
188
188
|
type: "asset",
|
|
189
189
|
fileName: bindingAsset.fileName,
|
|
190
190
|
originalFileName: bindingAsset.originalFileName || null,
|
|
191
|
+
originalFileNames: bindingAsset.originalFileNames,
|
|
191
192
|
get source() {
|
|
192
193
|
return transformAssetSource(bindingAsset.source);
|
|
193
194
|
},
|
|
194
|
-
name: bindingAsset.name ?? undefined
|
|
195
|
+
name: bindingAsset.name ?? undefined,
|
|
196
|
+
names: bindingAsset.names
|
|
195
197
|
};
|
|
196
198
|
const cache = {};
|
|
197
199
|
return new Proxy(asset, {
|
|
@@ -230,9 +232,9 @@ function collectChangedBundle(changed, bundle) {
|
|
|
230
232
|
const item = bundle[key];
|
|
231
233
|
if (item.type === "asset") assets.push({
|
|
232
234
|
filename: item.fileName,
|
|
233
|
-
|
|
235
|
+
originalFileNames: item.originalFileNames,
|
|
234
236
|
source: bindingAssetSource(item.source),
|
|
235
|
-
|
|
237
|
+
names: item.names
|
|
236
238
|
});
|
|
237
239
|
else chunks.push({
|
|
238
240
|
code: item.code,
|
|
@@ -1116,7 +1118,7 @@ const ModuleSideEffectsRuleSchema = z.object({
|
|
|
1116
1118
|
}).refine((data) => {
|
|
1117
1119
|
return data.test !== undefined || data.external !== undefined;
|
|
1118
1120
|
}, "Either `test` or `external` should be set.");
|
|
1119
|
-
const ModuleSideEffectsOptionSchema = z.boolean().or(z.array(ModuleSideEffectsRuleSchema)).or(z.literal("no-external"));
|
|
1121
|
+
const ModuleSideEffectsOptionSchema = z.boolean().or(z.array(ModuleSideEffectsRuleSchema)).or(z.function().args(z.string(), z.boolean()).returns(z.boolean().optional())).or(z.literal("no-external"));
|
|
1120
1122
|
const TreeshakingOptionsSchema = z.object({
|
|
1121
1123
|
moduleSideEffects: ModuleSideEffectsOptionSchema.optional(),
|
|
1122
1124
|
annotations: z.boolean().optional()
|
|
@@ -1996,7 +1998,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog,
|
|
|
1996
1998
|
profilerNames: inputOptions?.profilerNames,
|
|
1997
1999
|
jsx: bindingifyJsx(inputOptions.jsx),
|
|
1998
2000
|
watch: bindingifyWatch(inputOptions.watch),
|
|
1999
|
-
dropLabels: inputOptions.dropLabels
|
|
2001
|
+
dropLabels: inputOptions.dropLabels,
|
|
2002
|
+
keepNames: inputOptions.keepNames
|
|
2000
2003
|
};
|
|
2001
2004
|
}
|
|
2002
2005
|
function bindingifyExternal(external) {
|
|
@@ -2657,93 +2660,111 @@ const rolldown = async (input) => {
|
|
|
2657
2660
|
return new RolldownBuild(input);
|
|
2658
2661
|
};
|
|
2659
2662
|
|
|
2663
|
+
//#endregion
|
|
2664
|
+
//#region src/api/watch/watch-emitter.ts
|
|
2665
|
+
var WatcherEmitter = class {
|
|
2666
|
+
listeners = new Map();
|
|
2667
|
+
timer;
|
|
2668
|
+
constructor() {
|
|
2669
|
+
this.timer = setInterval(
|
|
2670
|
+
() => {},
|
|
2671
|
+
1e9
|
|
2672
|
+
/* Low power usage */
|
|
2673
|
+
);
|
|
2674
|
+
}
|
|
2675
|
+
on(event, listener) {
|
|
2676
|
+
const listeners = this.listeners.get(event);
|
|
2677
|
+
if (listeners) listeners.push(listener);
|
|
2678
|
+
else this.listeners.set(event, [listener]);
|
|
2679
|
+
return this;
|
|
2680
|
+
}
|
|
2681
|
+
async onEvent(event) {
|
|
2682
|
+
const listeners = this.listeners.get(event.eventKind());
|
|
2683
|
+
if (listeners) switch (event.eventKind()) {
|
|
2684
|
+
case "close":
|
|
2685
|
+
case "restart":
|
|
2686
|
+
for (const listener of listeners) await listener();
|
|
2687
|
+
break;
|
|
2688
|
+
case "event":
|
|
2689
|
+
for (const listener of listeners) {
|
|
2690
|
+
const code = event.bundleEventKind();
|
|
2691
|
+
switch (code) {
|
|
2692
|
+
case "BUNDLE_END":
|
|
2693
|
+
const { duration, output } = event.bundleEndData();
|
|
2694
|
+
await listener({
|
|
2695
|
+
code: "BUNDLE_END",
|
|
2696
|
+
duration,
|
|
2697
|
+
output: [output]
|
|
2698
|
+
});
|
|
2699
|
+
break;
|
|
2700
|
+
case "ERROR":
|
|
2701
|
+
const errors = event.errors();
|
|
2702
|
+
await listener({
|
|
2703
|
+
code: "ERROR",
|
|
2704
|
+
error: normalizeErrors(errors)
|
|
2705
|
+
});
|
|
2706
|
+
break;
|
|
2707
|
+
default:
|
|
2708
|
+
await listener({ code });
|
|
2709
|
+
break;
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
break;
|
|
2713
|
+
case "change":
|
|
2714
|
+
for (const listener of listeners) {
|
|
2715
|
+
const { path: path$2, kind } = event.watchChangeData();
|
|
2716
|
+
await listener(path$2, { event: kind });
|
|
2717
|
+
}
|
|
2718
|
+
break;
|
|
2719
|
+
default: throw new Error(`Unknown event: ${event}`);
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
async close() {
|
|
2723
|
+
clearInterval(this.timer);
|
|
2724
|
+
}
|
|
2725
|
+
};
|
|
2726
|
+
|
|
2660
2727
|
//#endregion
|
|
2661
2728
|
//#region src/api/watch/watcher.ts
|
|
2662
2729
|
var Watcher = class {
|
|
2663
2730
|
closed;
|
|
2664
|
-
controller;
|
|
2665
2731
|
inner;
|
|
2732
|
+
emitter;
|
|
2666
2733
|
stopWorkers;
|
|
2667
|
-
|
|
2668
|
-
constructor(inner, stopWorkers) {
|
|
2734
|
+
constructor(emitter, inner, stopWorkers) {
|
|
2669
2735
|
this.closed = false;
|
|
2670
|
-
this.controller = new AbortController();
|
|
2671
2736
|
this.inner = inner;
|
|
2737
|
+
this.emitter = emitter;
|
|
2738
|
+
const originClose = emitter.close.bind(emitter);
|
|
2739
|
+
emitter.close = async () => {
|
|
2740
|
+
await this.close();
|
|
2741
|
+
originClose();
|
|
2742
|
+
};
|
|
2672
2743
|
this.stopWorkers = stopWorkers;
|
|
2673
2744
|
}
|
|
2674
2745
|
async close() {
|
|
2746
|
+
if (this.closed) return;
|
|
2675
2747
|
this.closed = true;
|
|
2676
2748
|
await this.stopWorkers?.();
|
|
2677
2749
|
await this.inner.close();
|
|
2678
|
-
this.controller.abort();
|
|
2679
|
-
}
|
|
2680
|
-
on(event, listener) {
|
|
2681
|
-
const listeners = this.listeners.get(event);
|
|
2682
|
-
if (listeners) listeners.push(listener);
|
|
2683
|
-
else this.listeners.set(event, [listener]);
|
|
2684
|
-
return this;
|
|
2685
2750
|
}
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
() => {},
|
|
2689
|
-
1e9
|
|
2690
|
-
/* Low power usage */
|
|
2691
|
-
);
|
|
2692
|
-
this.controller.signal.addEventListener("abort", () => {
|
|
2693
|
-
clearInterval(timer);
|
|
2694
|
-
});
|
|
2695
|
-
process.nextTick(() => this.inner.start(async (event) => {
|
|
2696
|
-
const listeners = this.listeners.get(event.eventKind());
|
|
2697
|
-
if (listeners) switch (event.eventKind()) {
|
|
2698
|
-
case "close":
|
|
2699
|
-
case "restart":
|
|
2700
|
-
for (const listener of listeners) await listener();
|
|
2701
|
-
break;
|
|
2702
|
-
case "event":
|
|
2703
|
-
for (const listener of listeners) {
|
|
2704
|
-
const code = event.bundleEventKind();
|
|
2705
|
-
switch (code) {
|
|
2706
|
-
case "BUNDLE_END":
|
|
2707
|
-
const { duration, output } = event.bundleEndData();
|
|
2708
|
-
await listener({
|
|
2709
|
-
code: "BUNDLE_END",
|
|
2710
|
-
duration,
|
|
2711
|
-
output: [output]
|
|
2712
|
-
});
|
|
2713
|
-
break;
|
|
2714
|
-
case "ERROR":
|
|
2715
|
-
const errors = event.errors();
|
|
2716
|
-
await listener({
|
|
2717
|
-
code: "ERROR",
|
|
2718
|
-
error: normalizeErrors(errors)
|
|
2719
|
-
});
|
|
2720
|
-
break;
|
|
2721
|
-
default:
|
|
2722
|
-
await listener({ code });
|
|
2723
|
-
break;
|
|
2724
|
-
}
|
|
2725
|
-
}
|
|
2726
|
-
break;
|
|
2727
|
-
case "change":
|
|
2728
|
-
for (const listener of listeners) {
|
|
2729
|
-
const { path: path$2, kind } = event.watchChangeData();
|
|
2730
|
-
await listener(path$2, { event: kind });
|
|
2731
|
-
}
|
|
2732
|
-
break;
|
|
2733
|
-
default: throw new Error(`Unknown event: ${event}`);
|
|
2734
|
-
}
|
|
2735
|
-
}));
|
|
2751
|
+
start() {
|
|
2752
|
+
process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
|
|
2736
2753
|
}
|
|
2737
2754
|
};
|
|
2755
|
+
async function createWatcher(emitter, input) {
|
|
2756
|
+
const { bundler, stopWorkers } = await createBundler(input, input.output || {});
|
|
2757
|
+
const bindingWatcher = await bundler.watch();
|
|
2758
|
+
const watcher = new Watcher(emitter, bindingWatcher, stopWorkers);
|
|
2759
|
+
watcher.start();
|
|
2760
|
+
}
|
|
2738
2761
|
|
|
2739
2762
|
//#endregion
|
|
2740
2763
|
//#region src/api/watch/index.ts
|
|
2741
|
-
const watch =
|
|
2742
|
-
const
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
watcher.watch();
|
|
2746
|
-
return watcher;
|
|
2764
|
+
const watch = (input) => {
|
|
2765
|
+
const emitter = new WatcherEmitter();
|
|
2766
|
+
createWatcher(emitter, input);
|
|
2767
|
+
return emitter;
|
|
2747
2768
|
};
|
|
2748
2769
|
|
|
2749
2770
|
//#endregion
|
|
@@ -2756,10 +2777,14 @@ var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compat
|
|
|
2756
2777
|
async function build(options) {
|
|
2757
2778
|
if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
|
|
2758
2779
|
else {
|
|
2759
|
-
const { output,...inputOptions } = options;
|
|
2780
|
+
const { output, write = true,...inputOptions } = options;
|
|
2760
2781
|
const build$1 = await rolldown(inputOptions);
|
|
2761
|
-
|
|
2762
|
-
|
|
2782
|
+
try {
|
|
2783
|
+
if (write) return await build$1.write(output);
|
|
2784
|
+
else return await build$1.generate(output);
|
|
2785
|
+
} finally {
|
|
2786
|
+
await build$1.close();
|
|
2787
|
+
}
|
|
2763
2788
|
}
|
|
2764
2789
|
}
|
|
2765
2790
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { WatchOptions } from '../../options/watch-options';
|
|
2
|
-
import {
|
|
3
|
-
export declare const watch: (input: WatchOptions) =>
|
|
2
|
+
import { RolldownWatcher } from './watch-emitter';
|
|
3
|
+
export declare const watch: (input: WatchOptions) => RolldownWatcher;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BindingWatcherEvent } from '../../binding';
|
|
2
|
+
import { MaybePromise } from '../../types/utils';
|
|
3
|
+
export type WatcherEvent = 'close' | 'event' | 'restart' | 'change';
|
|
4
|
+
export type ChangeEvent = 'create' | 'update' | 'delete';
|
|
5
|
+
export type RollupWatcherEvent = {
|
|
6
|
+
code: 'START';
|
|
7
|
+
} | {
|
|
8
|
+
code: 'BUNDLE_START';
|
|
9
|
+
} | {
|
|
10
|
+
code: 'BUNDLE_END';
|
|
11
|
+
duration: number;
|
|
12
|
+
output: readonly string[];
|
|
13
|
+
} | {
|
|
14
|
+
code: 'END';
|
|
15
|
+
} | {
|
|
16
|
+
code: 'ERROR';
|
|
17
|
+
error: Error;
|
|
18
|
+
};
|
|
19
|
+
export declare class WatcherEmitter {
|
|
20
|
+
listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>;
|
|
21
|
+
timer: any;
|
|
22
|
+
constructor();
|
|
23
|
+
on(event: 'change', listener: (id: string, change: {
|
|
24
|
+
event: ChangeEvent;
|
|
25
|
+
}) => MaybePromise<void>): this;
|
|
26
|
+
on(event: 'event', listener: (data: RollupWatcherEvent) => MaybePromise<void>): this;
|
|
27
|
+
on(event: 'restart' | 'close', listener: () => MaybePromise<void>): this;
|
|
28
|
+
onEvent(event: BindingWatcherEvent): Promise<void>;
|
|
29
|
+
close(): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
export type RolldownWatcher = WatcherEmitter;
|
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
import { BindingWatcher } from '../../binding';
|
|
2
|
-
import {
|
|
2
|
+
import { WatchOptions } from '../../options/watch-options';
|
|
3
|
+
import { WatcherEmitter } from './watch-emitter';
|
|
3
4
|
export declare class Watcher {
|
|
4
5
|
closed: boolean;
|
|
5
|
-
controller: AbortController;
|
|
6
6
|
inner: BindingWatcher;
|
|
7
|
+
emitter: WatcherEmitter;
|
|
7
8
|
stopWorkers?: () => Promise<void>;
|
|
8
|
-
|
|
9
|
-
constructor(inner: BindingWatcher, stopWorkers?: () => Promise<void>);
|
|
9
|
+
constructor(emitter: WatcherEmitter, inner: BindingWatcher, stopWorkers?: () => Promise<void>);
|
|
10
10
|
close(): Promise<void>;
|
|
11
|
-
|
|
12
|
-
event: ChangeEvent;
|
|
13
|
-
}) => MaybePromise<void>): this;
|
|
14
|
-
on(event: 'event', listener: (data: RollupWatcherEvent) => MaybePromise<void>): this;
|
|
15
|
-
on(event: 'restart' | 'close', listener: () => MaybePromise<void>): this;
|
|
16
|
-
watch(): void;
|
|
11
|
+
start(): void;
|
|
17
12
|
}
|
|
18
|
-
export
|
|
19
|
-
export type ChangeEvent = 'create' | 'update' | 'delete';
|
|
20
|
-
export type RollupWatcherEvent = {
|
|
21
|
-
code: 'START';
|
|
22
|
-
} | {
|
|
23
|
-
code: 'BUNDLE_START';
|
|
24
|
-
} | {
|
|
25
|
-
code: 'BUNDLE_END';
|
|
26
|
-
duration: number;
|
|
27
|
-
output: readonly string[];
|
|
28
|
-
} | {
|
|
29
|
-
code: 'END';
|
|
30
|
-
} | {
|
|
31
|
-
code: 'ERROR';
|
|
32
|
-
error: Error;
|
|
33
|
-
};
|
|
13
|
+
export declare function createWatcher(emitter: WatcherEmitter, input: WatchOptions): Promise<void>;
|
package/dist/types/binding.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class BindingCallableBuiltinPlugin {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export declare class BindingHookError {
|
|
19
|
-
get errors(): Array<
|
|
19
|
+
get errors(): Array<Error | object>
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export declare class BindingLog {
|
|
@@ -68,8 +68,10 @@ export declare class BindingNormalizedOptions {
|
|
|
68
68
|
export declare class BindingOutputAsset {
|
|
69
69
|
get fileName(): string
|
|
70
70
|
get originalFileName(): string | null
|
|
71
|
+
get originalFileNames(): Array<string>
|
|
71
72
|
get source(): BindingAssetSource
|
|
72
73
|
get name(): string | null
|
|
74
|
+
get names(): Array<string>
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
export declare class BindingOutputChunk {
|
|
@@ -92,7 +94,7 @@ export declare class BindingOutputChunk {
|
|
|
92
94
|
export declare class BindingOutputs {
|
|
93
95
|
get chunks(): Array<BindingOutputChunk>
|
|
94
96
|
get assets(): Array<BindingOutputAsset>
|
|
95
|
-
get errors(): Array<
|
|
97
|
+
get errors(): Array<Error | object>
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
export declare class BindingPluginContext {
|
|
@@ -129,7 +131,7 @@ export declare class BindingWatcherEvent {
|
|
|
129
131
|
watchChangeData(): BindingWatcherChangeData
|
|
130
132
|
bundleEndData(): BindingBundleEndEventData
|
|
131
133
|
bundleEventKind(): string
|
|
132
|
-
errors(): Array<
|
|
134
|
+
errors(): Array<Error | object>
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
export declare class Bundler {
|
|
@@ -325,6 +327,7 @@ export interface BindingInputOptions {
|
|
|
325
327
|
profilerNames?: boolean
|
|
326
328
|
jsx?: JsxOptions
|
|
327
329
|
watch?: BindingWatchOption
|
|
330
|
+
keepNames?: boolean
|
|
328
331
|
}
|
|
329
332
|
|
|
330
333
|
export interface BindingJsonPluginConfig {
|
|
@@ -524,11 +527,12 @@ export interface BindingTransformPluginConfig {
|
|
|
524
527
|
exclude?: Array<BindingStringOrRegex>
|
|
525
528
|
jsxInject?: string
|
|
526
529
|
reactRefresh?: boolean
|
|
527
|
-
|
|
530
|
+
target?: string
|
|
531
|
+
browserslist?: string
|
|
528
532
|
}
|
|
529
533
|
|
|
530
534
|
export interface BindingTreeshake {
|
|
531
|
-
moduleSideEffects: boolean | BindingModuleSideEffectsRule[]
|
|
535
|
+
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined)
|
|
532
536
|
annotations?: boolean
|
|
533
537
|
}
|
|
534
538
|
|
|
@@ -537,7 +541,7 @@ export interface BindingViteResolvePluginConfig {
|
|
|
537
541
|
environmentConsumer: string
|
|
538
542
|
environmentName: string
|
|
539
543
|
external: true | string[]
|
|
540
|
-
noExternal: true | string
|
|
544
|
+
noExternal: true | Array<string | RegExp>
|
|
541
545
|
finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>
|
|
542
546
|
finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>
|
|
543
547
|
runtime: string
|
|
@@ -606,8 +610,8 @@ export interface JsChangedOutputs {
|
|
|
606
610
|
}
|
|
607
611
|
|
|
608
612
|
export interface JsOutputAsset {
|
|
609
|
-
|
|
610
|
-
|
|
613
|
+
names: Array<string>
|
|
614
|
+
originalFileNames: Array<string>
|
|
611
615
|
filename: string
|
|
612
616
|
source: BindingAssetSource
|
|
613
617
|
}
|
|
@@ -50,7 +50,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
50
50
|
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
|
|
51
51
|
shimMissingExports: z.ZodOptional<z.ZodBoolean>;
|
|
52
52
|
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
53
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
53
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
54
54
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
55
55
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
56
56
|
sideEffects: z.ZodBoolean;
|
|
@@ -70,10 +70,10 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
70
70
|
sideEffects: boolean;
|
|
71
71
|
external?: boolean | undefined;
|
|
72
72
|
test?: RegExp | undefined;
|
|
73
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
73
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
74
74
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
75
75
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
76
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
76
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
77
77
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
78
78
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
79
79
|
sideEffects: z.ZodBoolean;
|
|
@@ -93,10 +93,10 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
93
93
|
sideEffects: boolean;
|
|
94
94
|
external?: boolean | undefined;
|
|
95
95
|
test?: RegExp | undefined;
|
|
96
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
96
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
97
97
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
98
98
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
99
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
99
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
100
100
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
101
101
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
102
102
|
sideEffects: z.ZodBoolean;
|
|
@@ -116,7 +116,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
116
116
|
sideEffects: boolean;
|
|
117
117
|
external?: boolean | undefined;
|
|
118
118
|
test?: RegExp | undefined;
|
|
119
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
119
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
120
120
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
121
121
|
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
122
122
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,10 +20,10 @@ import { MinimalPluginContext } from './plugin/minimal-plugin-context';
|
|
|
20
20
|
import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap';
|
|
21
21
|
import { OutputBundle } from './types/output-bundle';
|
|
22
22
|
import { WatchOptions } from './options/watch-options';
|
|
23
|
-
import {
|
|
23
|
+
import { RolldownWatcher } from './api/watch/watch-emitter';
|
|
24
24
|
import { build, type BuildOptions } from './api/build';
|
|
25
25
|
export { defineConfig, rolldown, watch, build };
|
|
26
26
|
export declare const VERSION: string;
|
|
27
|
-
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions,
|
|
28
|
-
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, };
|
|
27
|
+
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, RolldownWatcher, BuildOptions, };
|
|
28
|
+
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, RolldownWatcher as RollupWatcher, };
|
|
29
29
|
export type { RollupError, RollupLog, LoggingFunction } from './rollup';
|
|
@@ -45,7 +45,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
45
45
|
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
|
|
46
46
|
shimMissingExports: z.ZodOptional<z.ZodBoolean>;
|
|
47
47
|
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
48
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
48
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
49
49
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
50
50
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
51
51
|
sideEffects: z.ZodBoolean;
|
|
@@ -65,10 +65,10 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
65
65
|
sideEffects: boolean;
|
|
66
66
|
external?: boolean | undefined;
|
|
67
67
|
test?: RegExp | undefined;
|
|
68
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
68
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
69
69
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
70
70
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
71
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
71
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
72
72
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
73
73
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
74
74
|
sideEffects: z.ZodBoolean;
|
|
@@ -88,10 +88,10 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
88
88
|
sideEffects: boolean;
|
|
89
89
|
external?: boolean | undefined;
|
|
90
90
|
test?: RegExp | undefined;
|
|
91
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
91
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
92
92
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
93
93
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
94
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
94
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
95
95
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
96
96
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
97
97
|
sideEffects: z.ZodBoolean;
|
|
@@ -111,7 +111,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
111
111
|
sideEffects: boolean;
|
|
112
112
|
external?: boolean | undefined;
|
|
113
113
|
test?: RegExp | undefined;
|
|
114
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
114
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
115
115
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
116
116
|
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
117
117
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
|
@@ -228,7 +228,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
228
228
|
} | undefined;
|
|
229
229
|
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
230
230
|
treeshake?: boolean | z.objectOutputType<{
|
|
231
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
231
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
232
232
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
233
233
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
234
234
|
sideEffects: z.ZodBoolean;
|
|
@@ -248,7 +248,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
248
248
|
sideEffects: boolean;
|
|
249
249
|
external?: boolean | undefined;
|
|
250
250
|
test?: RegExp | undefined;
|
|
251
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
251
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
252
252
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
253
253
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
254
254
|
inject?: Record<string, string | [string, string]> | undefined;
|
|
@@ -305,7 +305,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
305
305
|
} | undefined;
|
|
306
306
|
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
|
|
307
307
|
treeshake?: boolean | z.objectInputType<{
|
|
308
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
308
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
309
309
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
310
310
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
311
311
|
sideEffects: z.ZodBoolean;
|
|
@@ -325,7 +325,7 @@ export declare const inputOptionsSchema: z.ZodObject<{
|
|
|
325
325
|
sideEffects: boolean;
|
|
326
326
|
external?: boolean | undefined;
|
|
327
327
|
test?: RegExp | undefined;
|
|
328
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
328
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
329
329
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
330
330
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
331
331
|
inject?: Record<string, string | [string, string]> | undefined;
|
|
@@ -397,7 +397,7 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
397
397
|
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>;
|
|
398
398
|
shimMissingExports: z.ZodOptional<z.ZodBoolean>;
|
|
399
399
|
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
400
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
400
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
401
401
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
402
402
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
403
403
|
sideEffects: z.ZodBoolean;
|
|
@@ -417,10 +417,10 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
417
417
|
sideEffects: boolean;
|
|
418
418
|
external?: boolean | undefined;
|
|
419
419
|
test?: RegExp | undefined;
|
|
420
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
420
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
421
421
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
422
422
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
423
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
423
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
424
424
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
425
425
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
426
426
|
sideEffects: z.ZodBoolean;
|
|
@@ -440,10 +440,10 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
440
440
|
sideEffects: boolean;
|
|
441
441
|
external?: boolean | undefined;
|
|
442
442
|
test?: RegExp | undefined;
|
|
443
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
443
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
444
444
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
445
445
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
446
|
-
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
446
|
+
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
447
447
|
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>;
|
|
448
448
|
external: z.ZodOptional<z.ZodBoolean>;
|
|
449
449
|
sideEffects: z.ZodBoolean;
|
|
@@ -463,7 +463,7 @@ export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extend
|
|
|
463
463
|
sideEffects: boolean;
|
|
464
464
|
external?: boolean | undefined;
|
|
465
465
|
test?: RegExp | undefined;
|
|
466
|
-
}>, "many">]>, z.ZodLiteral<"no-external">]>>;
|
|
466
|
+
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
|
|
467
467
|
annotations: z.ZodOptional<z.ZodBoolean>;
|
|
468
468
|
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>;
|
|
469
469
|
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>;
|
package/dist/types/rollup.d.ts
CHANGED
|
@@ -906,8 +906,12 @@ export interface SerializedTimings {
|
|
|
906
906
|
}
|
|
907
907
|
|
|
908
908
|
export interface PreRenderedAsset {
|
|
909
|
+
/** @deprecated Use "names" instead. */
|
|
909
910
|
name: string | undefined
|
|
911
|
+
names: string[]
|
|
912
|
+
/** @deprecated Use "originalFileNames" instead. */
|
|
910
913
|
originalFileName: string | null
|
|
914
|
+
originalFileNames: string[]
|
|
911
915
|
source: string | Uint8Array
|
|
912
916
|
type: 'asset'
|
|
913
917
|
}
|