@rolldown/browser 1.0.0-rc.6 → 1.0.0-rc.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.
Files changed (46) hide show
  1. package/dist/cli.mjs +10 -21
  2. package/dist/config.d.mts +1 -1
  3. package/dist/config.mjs +9 -10
  4. package/dist/{constructors-WyngiSlS.js → constructors-BgL_dmUe.js} +2 -4
  5. package/dist/{error-D4EjR7H_.js → error-DkAP_6fk.js} +1 -6
  6. package/dist/experimental-index.browser.mjs +22 -19
  7. package/dist/experimental-index.d.mts +18 -4
  8. package/dist/experimental-index.mjs +24 -21
  9. package/dist/filter-index.d.mts +1 -1
  10. package/dist/filter-index.mjs +2 -6
  11. package/dist/get-log-filter.mjs +1 -2
  12. package/dist/index.browser.mjs +67 -73
  13. package/dist/index.d.mts +2 -2
  14. package/dist/index.mjs +9 -12
  15. package/dist/{normalize-string-or-regex-B0X1hEA4.js → normalize-string-or-regex-TtAGUp42.js} +5 -11
  16. package/dist/parallel-plugin-worker.mjs +6 -8
  17. package/dist/parallel-plugin.d.mts +1 -1
  18. package/dist/parallel-plugin.mjs +1 -2
  19. package/dist/parse-ast-index.mjs +3 -5
  20. package/dist/plugins-index.browser.mjs +3 -5
  21. package/dist/plugins-index.mjs +3 -5
  22. package/dist/rolldown-binding.wasi-browser.js +0 -1
  23. package/dist/rolldown-binding.wasi.cjs +0 -1
  24. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  25. package/dist/{rolldown-build-DwnjyX40.js → rolldown-build-D97C-VhN.js} +440 -522
  26. package/dist/shared/{bindingify-input-options-CSIYh5O4.mjs → bindingify-input-options-kCVufQp0.mjs} +33 -56
  27. package/dist/shared/{composable-filters-C_jBPRPI.mjs → composable-filters-B2ByPP8y.mjs} +1 -4
  28. package/dist/shared/{constructors-B2viugwd.mjs → constructors-C7Kkidxk.mjs} +2 -4
  29. package/dist/shared/{define-config-DMEhSrNE.d.mts → define-config-Cci3IvO_.d.mts} +65 -29
  30. package/dist/shared/{define-config-BMj_QknW.mjs → define-config-DJOr6Iwt.mjs} +1 -2
  31. package/dist/shared/{error-DDzqVYr_.mjs → error-CQ6njWsV.mjs} +1 -4
  32. package/dist/shared/{load-config-CmC4WvoS.mjs → load-config-DNGVjxdv.mjs} +2 -4
  33. package/dist/shared/{logs-CCc_0vhs.mjs → logs-D80CXhvg.mjs} +5 -8
  34. package/dist/shared/{normalize-string-or-regex-FTOVR1Jb.mjs → normalize-string-or-regex-CF3Uz6aU.mjs} +2 -5
  35. package/dist/shared/{parse-DIZtKd4C.mjs → parse-DDUnGYGU.mjs} +1 -4
  36. package/dist/shared/{prompt-B56gTa4S.mjs → prompt-BYQIwEjg.mjs} +1 -3
  37. package/dist/shared/{rolldown-D7O5_axp.mjs → rolldown-C9kn7lTZ.mjs} +2 -4
  38. package/dist/shared/{rolldown-build-BV90HQts.mjs → rolldown-build-8_xyZuDH.mjs} +423 -472
  39. package/dist/shared/{transform-D49mi4JH.mjs → transform-B_n5An0U.mjs} +2 -5
  40. package/dist/shared/{watch-COON6c2j.mjs → watch-dCFQWE8a.mjs} +69 -75
  41. package/dist/{transform-qJgOBSav.js → transform-UkHb5h4g.js} +2 -5
  42. package/dist/utils-index.browser.mjs +7 -16
  43. package/dist/utils-index.mjs +8 -17
  44. package/package.json +1 -1
  45. package/dist/cli-setup.d.mts +0 -1
  46. package/dist/cli-setup.mjs +0 -16
@@ -1,8 +1,7 @@
1
- import { d as logMultiplyNotifyOption } from "./normalize-string-or-regex-B0X1hEA4.js";
2
- import { a as PluginDriver, c as RUNTIME_MODULE_ID, i as validateOption, l as VERSION, n as createBundlerOptions, o as LOG_LEVEL_WARN, s as arraify, t as RolldownBuild } from "./rolldown-build-DwnjyX40.js";
3
- import { t as aggregateBindingErrorsIntoJsError } from "./error-D4EjR7H_.js";
1
+ import { d as logMultipleWatcherOption } from "./normalize-string-or-regex-TtAGUp42.js";
2
+ import { a as PluginDriver, c as RUNTIME_MODULE_ID, i as validateOption, l as VERSION, n as createBundlerOptions, o as LOG_LEVEL_WARN, s as arraify, t as RolldownBuild } from "./rolldown-build-D97C-VhN.js";
3
+ import { t as aggregateBindingErrorsIntoJsError } from "./error-DkAP_6fk.js";
4
4
  import { BindingMagicString, BindingWatcher, shutdownAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
5
-
6
5
  //#region src/api/rolldown/index.ts
7
6
  /**
8
7
  * The API compatible with Rollup's `rollup` function.
@@ -40,7 +39,6 @@ const rolldown = async (input) => {
40
39
  validateOption("input", input);
41
40
  return new RolldownBuild(await PluginDriver.callOptionsHook(input));
42
41
  };
43
-
44
42
  //#endregion
45
43
  //#region src/api/build.ts
46
44
  /**
@@ -75,15 +73,10 @@ async function build(options) {
75
73
  }
76
74
  }
77
75
  }
78
-
79
76
  //#endregion
80
77
  //#region src/api/watch/watch-emitter.ts
81
78
  var WatcherEmitter = class {
82
79
  listeners = /* @__PURE__ */ new Map();
83
- timer;
84
- constructor() {
85
- this.timer = setInterval(() => {}, 1e9);
86
- }
87
80
  on(event, listener) {
88
81
  const listeners = this.listeners.get(event);
89
82
  if (listeners) listeners.push(listener);
@@ -99,58 +92,55 @@ var WatcherEmitter = class {
99
92
  return this;
100
93
  }
101
94
  clear(event) {
102
- if (this.listeners.has(event)) this.listeners.delete(event);
95
+ this.listeners.delete(event);
103
96
  }
104
- async onEvent(event) {
105
- const listeners = this.listeners.get(event.eventKind());
106
- if (listeners) switch (event.eventKind()) {
107
- case "close":
108
- case "restart":
109
- for (const listener of listeners) await listener();
110
- break;
111
- case "event":
112
- for (const listener of listeners) {
113
- const code = event.bundleEventKind();
114
- switch (code) {
115
- case "BUNDLE_END":
116
- const { duration, output, result } = event.bundleEndData();
117
- await listener({
118
- code: "BUNDLE_END",
119
- duration,
120
- output: [output],
121
- result
122
- });
123
- break;
124
- case "ERROR":
125
- const data = event.bundleErrorData();
126
- await listener({
127
- code: "ERROR",
128
- error: aggregateBindingErrorsIntoJsError(data.error),
129
- result: data.result
130
- });
131
- break;
132
- default:
133
- await listener({ code });
134
- break;
135
- }
136
- }
137
- break;
138
- case "change":
139
- for (const listener of listeners) {
140
- const { path, kind } = event.watchChangeData();
141
- await listener(path, { event: kind });
142
- }
143
- break;
144
- default: throw new Error(`Unknown event: ${event}`);
145
- }
146
- }
147
- async close() {
148
- clearInterval(this.timer);
97
+ /** Async emit — sequential dispatch so side effects from earlier handlers
98
+ * (e.g. `event.result.close()` triggering `closeBundle`) are visible to later handlers. */
99
+ async emit(event, ...args) {
100
+ const handlers = this.listeners.get(event);
101
+ if (handlers?.length) for (const h of handlers) await h(...args);
149
102
  }
103
+ async close() {}
150
104
  };
151
-
152
105
  //#endregion
153
106
  //#region src/api/watch/watcher.ts
107
+ function createEventCallback(emitter) {
108
+ return async (event) => {
109
+ switch (event.eventKind()) {
110
+ case "event": {
111
+ const code = event.bundleEventKind();
112
+ if (code === "BUNDLE_END") {
113
+ const { duration, output, result } = event.bundleEndData();
114
+ await emitter.emit("event", {
115
+ code: "BUNDLE_END",
116
+ duration,
117
+ output: [output],
118
+ result
119
+ });
120
+ } else if (code === "ERROR") {
121
+ const data = event.bundleErrorData();
122
+ await emitter.emit("event", {
123
+ code: "ERROR",
124
+ error: aggregateBindingErrorsIntoJsError(data.error),
125
+ result: data.result
126
+ });
127
+ } else await emitter.emit("event", { code });
128
+ break;
129
+ }
130
+ case "change": {
131
+ const { path, kind } = event.watchChangeData();
132
+ await emitter.emit("change", path, { event: kind });
133
+ break;
134
+ }
135
+ case "restart":
136
+ await emitter.emit("restart");
137
+ break;
138
+ case "close":
139
+ await emitter.emit("close");
140
+ break;
141
+ }
142
+ };
143
+ }
154
144
  var Watcher = class {
155
145
  closed;
156
146
  inner;
@@ -166,6 +156,7 @@ var Watcher = class {
166
156
  originClose();
167
157
  };
168
158
  this.stopWorkers = stopWorkers;
159
+ process.nextTick(() => this.run());
169
160
  }
170
161
  async close() {
171
162
  if (this.closed) return;
@@ -174,8 +165,9 @@ var Watcher = class {
174
165
  await this.inner.close();
175
166
  shutdownAsyncRuntime();
176
167
  }
177
- start() {
178
- process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
168
+ async run() {
169
+ await this.inner.run();
170
+ this.inner.waitForClose();
179
171
  }
180
172
  };
181
173
  async function createWatcher(emitter, input) {
@@ -183,20 +175,24 @@ async function createWatcher(emitter, input) {
183
175
  const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
184
176
  return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
185
177
  })).flat());
186
- const notifyOptions = getValidNotifyOption(bundlerOptions);
187
- new Watcher(emitter, new BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions), bundlerOptions.map((option) => option.stopWorkers)).start();
178
+ warnMultiplePollingOptions(bundlerOptions);
179
+ const callback = createEventCallback(emitter);
180
+ new Watcher(emitter, new BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), callback), bundlerOptions.map((option) => option.stopWorkers));
188
181
  }
189
- function getValidNotifyOption(bundlerOptions) {
190
- let result;
191
- for (const option of bundlerOptions) if (option.inputOptions.watch) {
192
- const notifyOption = option.inputOptions.watch.notify;
193
- if (notifyOption) if (result) {
194
- option.onLog(LOG_LEVEL_WARN, logMultiplyNotifyOption());
195
- return result;
196
- } else result = notifyOption;
182
+ function warnMultiplePollingOptions(bundlerOptions) {
183
+ let found = false;
184
+ for (const option of bundlerOptions) {
185
+ const watch = option.inputOptions.watch;
186
+ const watcher = watch && typeof watch === "object" ? watch.watcher ?? watch.notify : void 0;
187
+ if (watcher && (watcher.usePolling != null || watcher.pollInterval != null)) {
188
+ if (found) {
189
+ option.onLog(LOG_LEVEL_WARN, logMultipleWatcherOption());
190
+ return;
191
+ }
192
+ found = true;
193
+ }
197
194
  }
198
195
  }
199
-
200
196
  //#endregion
201
197
  //#region src/api/watch/index.ts
202
198
  /**
@@ -233,12 +229,10 @@ function watch(input) {
233
229
  createWatcher(emitter, input);
234
230
  return emitter;
235
231
  }
236
-
237
232
  //#endregion
238
233
  //#region src/utils/define-config.ts
239
234
  function defineConfig(config) {
240
235
  return config;
241
236
  }
242
-
243
237
  //#endregion
244
- export { BindingMagicString, RUNTIME_MODULE_ID, VERSION, build, defineConfig, rolldown, watch };
238
+ export { BindingMagicString, RUNTIME_MODULE_ID, VERSION, build, defineConfig, rolldown, watch };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-C6h4g8dA.mjs";
2
- import { $ as VERSION, $t as OutputOptions, A as TransformResult, At as watch, Bt as AdvancedChunksGroup, C as Plugin, Ct as InternalModuleFormat, D as RolldownPlugin, Dt as ChecksOptions, E as ResolvedId, Et as TransformOptions, Ft as rolldown, Gt as CodeSplittingNameFunction, Ht as ChunkFileNamesFunction, It as RolldownBuild, Jt as GeneratedCodeOptions, Kt as CodeSplittingOptions, Lt as BuildOptions, Mt as RolldownWatcherEvent, Nt as RolldownWatcherWatcherEventMap, O as RolldownPluginOption, Ot as LoggingFunction, Pt as WatchOptions, Q as RUNTIME_MODULE_ID, Qt as ModuleFormat, Rt as build, S as PartialResolvedId, St as RolldownFsModule, T as ResolveIdResult, Tt as NormalizedInputOptions, Ut as ChunkingContext, Vt as AdvancedChunksOptions, Wt as CodeSplittingGroup, X as BindingMagicString, Xt as GlobalsFunction, Yt as GeneratedCodePreset, Z as PreRenderedChunk, Zt as MinifyOptions, _ as LoadResult, _t as HookFilter, a as ExternalOption, an as RolldownOutput, at as EmittedAsset, b as ObjectHook, bt as RolldownDirectoryEntry, c as InputOptions, cn as ModuleInfo, ct as EmittedPrebuiltChunk, d as WatcherOptions, dt as PluginContextResolveOptions, en as PreRenderedAsset, et as ExistingRawSourceMap, f as AsyncPluginHooks, ft as DefineParallelPluginResult, g as ImportKind, gt as GeneralHookFilter, h as HookFilterExtension, ht as PluginContextMeta, i as RolldownOptions, in as RenderedModule, it as TransformPluginContext, jt as RolldownWatcher, k as SourceDescription, kt as WarningHandlerWithDefault, l as ModuleTypes, ln as SourcemapIgnoreListOption, lt as GetModuleInfo, m as FunctionPluginHooks, mt as MinimalPluginContext, n as RolldownOptionsFunction, nn as OutputChunk, nt as OutputBundle, o as ExternalOptionFunction, on as SourceMap, ot as EmittedChunk, p as CustomPluginOptions, qt as CommentsOptions, r as defineConfig, rn as RenderedChunk, rt as TreeshakingOptions, s as InputOption, st as EmittedFile, t as ConfigExport, tn as OutputAsset, tt as SourceMapInput, u as OptimizationOptions, ut as PluginContext, v as ModuleOptions, vt as ModuleTypeFilter, w as ResolveIdExtraOptions, wt as NormalizedOutputOptions, x as ParallelPluginHooks, xt as RolldownFileStats, y as ModuleType, yt as BufferEncoding, zt as AddonFunction } from "./shared/define-config-DMEhSrNE.mjs";
2
+ import { $ as RUNTIME_MODULE_ID, $t as MinifyOptions, A as SourceDescription, At as LoggingFunction, Bt as build, C as PartialResolvedId, Ct as RolldownFileStats, D as ResolvedId, Dt as NormalizedInputOptions, E as ResolveIdResult, Et as NormalizedOutputOptions, Ft as RolldownWatcherWatcherEventMap, Gt as ChunkingContext, Ht as AdvancedChunksGroup, It as WatchOptions, Jt as CodeSplittingOptions, Kt as CodeSplittingGroup, Lt as rolldown, Mt as watch, Nt as RolldownWatcher, O as RolldownPlugin, Ot as TransformOptions, Pt as RolldownWatcherEvent, Q as PreRenderedChunk, Qt as GlobalsFunction, Rt as RolldownBuild, S as ParallelPluginHooks, St as RolldownDirectoryEntry, T as ResolveIdExtraOptions, Tt as InternalModuleFormat, Ut as AdvancedChunksOptions, Vt as AddonFunction, Wt as ChunkFileNamesFunction, Xt as GeneratedCodeOptions, Yt as CommentsOptions, Z as BindingMagicString, Zt as GeneratedCodePreset, _ as ImportKind, _t as PluginContextMeta, a as ExternalOption, an as RenderedChunk, at as TreeshakingOptions, b as ModuleType, bt as ModuleTypeFilter, c as InputOptions, cn as SourceMap, ct as EmittedChunk, d as WatcherFileWatcherOptions, dn as SourcemapIgnoreListOption, dt as GetModuleInfo, en as ModuleFormat, et as VERSION, f as WatcherOptions, ft as PluginContext, g as HookFilterExtension, gt as MinimalPluginContext, h as FunctionPluginHooks, i as RolldownOptions, in as OutputChunk, it as OutputBundle, j as TransformResult, jt as WarningHandlerWithDefault, k as RolldownPluginOption, kt as ChecksOptions, l as ModuleTypes, lt as EmittedFile, m as CustomPluginOptions, mt as DefineParallelPluginResult, n as RolldownOptionsFunction, nn as PreRenderedAsset, nt as ExistingRawSourceMap, o as ExternalOptionFunction, on as RenderedModule, ot as TransformPluginContext, p as AsyncPluginHooks, pt as PluginContextResolveOptions, qt as CodeSplittingNameFunction, r as defineConfig, rn as OutputAsset, rt as SourceMapInput, s as InputOption, sn as RolldownOutput, st as EmittedAsset, t as ConfigExport, tn as OutputOptions, tt as BundleError, u as OptimizationOptions, un as ModuleInfo, ut as EmittedPrebuiltChunk, v as LoadResult, vt as GeneralHookFilter, w as Plugin, wt as RolldownFsModule, x as ObjectHook, xt as BufferEncoding, y as ModuleOptions, yt as HookFilter, zt as BuildOptions } from "./shared/define-config-Cci3IvO_.mjs";
3
3
  import { o as PartialNull } from "./shared/utils-6wxe_LMG.mjs";
4
- export { AddonFunction, AdvancedChunksGroup, AdvancedChunksOptions, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, CodeSplittingGroup, CodeSplittingNameFunction, CodeSplittingOptions, CommentsOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedChunk, EmittedFile, EmittedPrebuiltChunk, ExistingRawSourceMap, ExternalOption, ExternalOptionFunction, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PluginContextResolveOptions, PreRenderedAsset, PreRenderedChunk, RUNTIME_MODULE_ID, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownError, RolldownError as RollupError, RolldownFileStats, RolldownFsModule, RolldownLog, RolldownLog as RollupLog, RolldownLogWithString, RolldownLogWithString as RollupLogWithString, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RolldownWatcherWatcherEventMap, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformOptions, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
4
+ export { AddonFunction, AdvancedChunksGroup, AdvancedChunksOptions, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, BundleError, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, CodeSplittingGroup, CodeSplittingNameFunction, CodeSplittingOptions, CommentsOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedChunk, EmittedFile, EmittedPrebuiltChunk, ExistingRawSourceMap, ExternalOption, ExternalOptionFunction, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PluginContextResolveOptions, PreRenderedAsset, PreRenderedChunk, RUNTIME_MODULE_ID, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownError, RolldownError as RollupError, RolldownFileStats, RolldownFsModule, RolldownLog, RolldownLog as RollupLog, RolldownLogWithString, RolldownLogWithString as RollupLogWithString, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RolldownWatcherWatcherEventMap, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformOptions, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherFileWatcherOptions, WatcherOptions, build, defineConfig, rolldown, watch };
package/dist/index.mjs CHANGED
@@ -1,14 +1,13 @@
1
- import { n as onExit, t as watch } from "./shared/watch-COON6c2j.mjs";
2
- import "./shared/normalize-string-or-regex-FTOVR1Jb.mjs";
3
- import { b as VERSION, y as RUNTIME_MODULE_ID } from "./shared/bindingify-input-options-CSIYh5O4.mjs";
4
- import "./shared/rolldown-build-BV90HQts.mjs";
5
- import "./shared/error-DDzqVYr_.mjs";
6
- import "./shared/parse-DIZtKd4C.mjs";
7
- import { t as rolldown } from "./shared/rolldown-D7O5_axp.mjs";
8
- import { t as defineConfig } from "./shared/define-config-BMj_QknW.mjs";
1
+ import { n as onExit, t as watch } from "./shared/watch-dCFQWE8a.mjs";
2
+ import "./shared/normalize-string-or-regex-CF3Uz6aU.mjs";
3
+ import { b as VERSION, y as RUNTIME_MODULE_ID } from "./shared/bindingify-input-options-kCVufQp0.mjs";
4
+ import "./shared/rolldown-build-8_xyZuDH.mjs";
5
+ import "./shared/error-CQ6njWsV.mjs";
6
+ import "./shared/parse-DDUnGYGU.mjs";
7
+ import { t as rolldown } from "./shared/rolldown-C9kn7lTZ.mjs";
8
+ import { t as defineConfig } from "./shared/define-config-DJOr6Iwt.mjs";
9
9
  import { isMainThread } from "node:worker_threads";
10
10
  import { BindingMagicString, initTraceSubscriber } from "./rolldown-binding.wasi.cjs";
11
-
12
11
  //#region src/setup.ts
13
12
  if (isMainThread) {
14
13
  const subscriberGuard = initTraceSubscriber();
@@ -16,7 +15,6 @@ if (isMainThread) {
16
15
  subscriberGuard?.close();
17
16
  });
18
17
  }
19
-
20
18
  //#endregion
21
19
  //#region src/api/build.ts
22
20
  /**
@@ -51,6 +49,5 @@ async function build(options) {
51
49
  }
52
50
  }
53
51
  }
54
-
55
52
  //#endregion
56
- export { BindingMagicString, RUNTIME_MODULE_ID, VERSION, build, defineConfig, rolldown, watch };
53
+ export { BindingMagicString, RUNTIME_MODULE_ID, VERSION, build, defineConfig, rolldown, watch };
@@ -1,5 +1,4 @@
1
1
  import { BindingCallableBuiltinPlugin } from "./rolldown-binding.wasi-browser.js";
2
-
3
2
  //#region src/utils/code-frame.ts
4
3
  function spaces(index) {
5
4
  let result = "";
@@ -37,7 +36,6 @@ function getCodeFrame(source, line, column) {
37
36
  return `${lineNumber}: ${displayedLine}`;
38
37
  }).join("\n");
39
38
  }
40
-
41
39
  //#endregion
42
40
  //#region src/log/locate-character/index.js
43
41
  /** @typedef {import('./types').Location} Location */
@@ -98,10 +96,9 @@ function getLocator(source, options = {}) {
98
96
  function locate(source, search, options) {
99
97
  return getLocator(source, options)(search, options && options.startIndex);
100
98
  }
101
-
102
99
  //#endregion
103
100
  //#region src/log/logs.ts
104
- const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
101
+ const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLE_WATCHER_OPTION = "MULTIPLE_WATCHER_OPTION", PARSE_ERROR = "PARSE_ERROR", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
105
102
  function logParseError(message, id, pos) {
106
103
  return {
107
104
  code: PARSE_ERROR,
@@ -128,10 +125,10 @@ function logCycleLoading(pluginName, moduleId) {
128
125
  message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
129
126
  };
130
127
  }
131
- function logMultiplyNotifyOption() {
128
+ function logMultipleWatcherOption() {
132
129
  return {
133
- code: MULTIPLY_NOTIFY_OPTION,
134
- message: `Found multiply notify option at watch options, using first one to start notify watcher.`
130
+ code: MULTIPLE_WATCHER_OPTION,
131
+ message: `Found multiple watcher options at watch options, using first one to start watcher.`
135
132
  };
136
133
  }
137
134
  function logNoFileSystemInBrowser(method) {
@@ -186,7 +183,6 @@ function augmentCodeLocation(properties, pos, source, id) {
186
183
  properties.frame = getCodeFrame(source, line, column);
187
184
  }
188
185
  }
189
-
190
186
  //#endregion
191
187
  //#region src/builtin-plugin/utils.ts
192
188
  var BuiltinPlugin = class {
@@ -231,7 +227,6 @@ function bindingifyManifestPlugin(plugin, pluginContextData) {
231
227
  }
232
228
  };
233
229
  }
234
-
235
230
  //#endregion
236
231
  //#region src/utils/normalize-string-or-regex.ts
237
232
  function normalizedStringOrRegex(pattern) {
@@ -242,6 +237,5 @@ function normalizedStringOrRegex(pattern) {
242
237
  function isReadonlyArray(input) {
243
238
  return Array.isArray(input);
244
239
  }
245
-
246
240
  //#endregion
247
- export { makeBuiltinPluginCallable as a, logCycleLoading as c, logMultiplyNotifyOption as d, logNoFileSystemInBrowser as f, getCodeFrame as g, locate as h, bindingifyManifestPlugin as i, logInputHookInOutputPlugin as l, logPluginError as m, BuiltinPlugin as n, augmentCodeLocation as o, logParseError as p, bindingifyBuiltInPlugin as r, error as s, normalizedStringOrRegex as t, logInvalidLogPosition as u };
241
+ export { makeBuiltinPluginCallable as a, logCycleLoading as c, logMultipleWatcherOption as d, logNoFileSystemInBrowser as f, getCodeFrame as g, locate as h, bindingifyManifestPlugin as i, logInputHookInOutputPlugin as l, logPluginError as m, BuiltinPlugin as n, augmentCodeLocation as o, logParseError as p, bindingifyBuiltInPlugin as r, error as s, normalizedStringOrRegex as t, logInvalidLogPosition as u };
@@ -1,10 +1,9 @@
1
- import "./shared/normalize-string-or-regex-FTOVR1Jb.mjs";
2
- import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-CSIYh5O4.mjs";
3
- import "./shared/error-DDzqVYr_.mjs";
4
- import "./shared/parse-DIZtKd4C.mjs";
1
+ import "./shared/normalize-string-or-regex-CF3Uz6aU.mjs";
2
+ import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-kCVufQp0.mjs";
3
+ import "./shared/error-CQ6njWsV.mjs";
4
+ import "./shared/parse-DDUnGYGU.mjs";
5
5
  import { parentPort, workerData } from "node:worker_threads";
6
6
  import { registerPlugins } from "./rolldown-binding.wasi.cjs";
7
-
8
7
  //#region src/parallel-plugin-worker.ts
9
8
  const { registryId, pluginInfos, threadNumber } = workerData;
10
9
  (async () => {
@@ -14,7 +13,7 @@ const { registryId, pluginInfos, threadNumber } = workerData;
14
13
  const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
15
14
  return {
16
15
  index: pluginInfo.index,
17
- plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, []), [], () => {}, "info", false)
16
+ plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, [], []), [], () => {}, "info", false)
18
17
  };
19
18
  })));
20
19
  parentPort.postMessage({ type: "success" });
@@ -27,6 +26,5 @@ const { registryId, pluginInfos, threadNumber } = workerData;
27
26
  parentPort.unref();
28
27
  }
29
28
  })();
30
-
31
29
  //#endregion
32
- export { };
30
+ export {};
@@ -1,4 +1,4 @@
1
- import { C as Plugin } from "./shared/define-config-DMEhSrNE.mjs";
1
+ import { w as Plugin } from "./shared/define-config-Cci3IvO_.mjs";
2
2
  import { i as MaybePromise } from "./shared/utils-6wxe_LMG.mjs";
3
3
 
4
4
  //#region src/plugin/parallel-plugin-implementation.d.ts
@@ -2,6 +2,5 @@
2
2
  function defineParallelPluginImplementation(plugin) {
3
3
  return plugin;
4
4
  }
5
-
6
5
  //#endregion
7
- export { defineParallelPluginImplementation };
6
+ export { defineParallelPluginImplementation };
@@ -1,6 +1,5 @@
1
- import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-CCc_0vhs.mjs";
2
- import { n as parseSync, t as parse } from "./shared/parse-DIZtKd4C.mjs";
3
-
1
+ import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-D80CXhvg.mjs";
2
+ import { n as parseSync, t as parse } from "./shared/parse-DDUnGYGU.mjs";
4
3
  //#region src/parse-ast-index.ts
5
4
  function wrap(result, filename, sourceText) {
6
5
  if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
@@ -57,6 +56,5 @@ async function parseAstAsync(sourceText, options, filename) {
57
56
  ...options
58
57
  }), filename, sourceText);
59
58
  }
60
-
61
59
  //#endregion
62
- export { parseAst, parseAstAsync };
60
+ export { parseAst, parseAstAsync };
@@ -1,6 +1,5 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./normalize-string-or-regex-B0X1hEA4.js";
2
- import { t as esmExternalRequirePlugin } from "./constructors-WyngiSlS.js";
3
-
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./normalize-string-or-regex-TtAGUp42.js";
2
+ import { t as esmExternalRequirePlugin } from "./constructors-BgL_dmUe.js";
4
3
  //#region src/builtin-plugin/replace-plugin.ts
5
4
  /**
6
5
  * Replaces targeted strings in files while bundling.
@@ -37,6 +36,5 @@ function replacePlugin(values = {}, options = {}) {
37
36
  values
38
37
  }));
39
38
  }
40
-
41
39
  //#endregion
42
- export { esmExternalRequirePlugin, replacePlugin };
40
+ export { esmExternalRequirePlugin, replacePlugin };
@@ -1,6 +1,5 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-FTOVR1Jb.mjs";
2
- import { t as esmExternalRequirePlugin } from "./shared/constructors-B2viugwd.mjs";
3
-
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-CF3Uz6aU.mjs";
2
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-C7Kkidxk.mjs";
4
3
  //#region src/builtin-plugin/replace-plugin.ts
5
4
  /**
6
5
  * Replaces targeted strings in files while bundling.
@@ -37,6 +36,5 @@ function replacePlugin(values = {}, options = {}) {
37
36
  values
38
37
  }));
39
38
  }
40
-
41
39
  //#endregion
42
- export { esmExternalRequirePlugin, replacePlugin };
40
+ export { esmExternalRequirePlugin, replacePlugin };
@@ -121,7 +121,6 @@ export const BindingPropertyReadSideEffects = __napiModule.exports.BindingProper
121
121
  export const BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
122
122
  export const BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
123
123
  export const collapseSourcemaps = __napiModule.exports.collapseSourcemaps
124
- export const createTokioRuntime = __napiModule.exports.createTokioRuntime
125
124
  export const enhancedTransform = __napiModule.exports.enhancedTransform
126
125
  export const enhancedTransformSync = __napiModule.exports.enhancedTransformSync
127
126
  export const FilterTokenKind = __napiModule.exports.FilterTokenKind
@@ -166,7 +166,6 @@ module.exports.BindingPropertyReadSideEffects = __napiModule.exports.BindingProp
166
166
  module.exports.BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
167
167
  module.exports.BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
168
168
  module.exports.collapseSourcemaps = __napiModule.exports.collapseSourcemaps
169
- module.exports.createTokioRuntime = __napiModule.exports.createTokioRuntime
170
169
  module.exports.enhancedTransform = __napiModule.exports.enhancedTransform
171
170
  module.exports.enhancedTransformSync = __napiModule.exports.enhancedTransformSync
172
171
  module.exports.FilterTokenKind = __napiModule.exports.FilterTokenKind