@rollipop/rolldown 1.0.20 → 1.0.22

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 (39) hide show
  1. package/dist/cli.mjs +11 -8
  2. package/dist/config.d.mts +15 -2
  3. package/dist/config.mjs +2 -2
  4. package/dist/experimental-index.d.mts +8 -8
  5. package/dist/experimental-index.mjs +16 -13
  6. package/dist/filter-index.d.mts +1 -1
  7. package/dist/filter-index.mjs +2 -2
  8. package/dist/get-log-filter.d.mts +1 -1
  9. package/dist/get-log-filter.mjs +2 -2
  10. package/dist/index.d.mts +3 -3
  11. package/dist/index.mjs +11 -5
  12. package/dist/parallel-plugin-worker.mjs +5 -4
  13. package/dist/parallel-plugin.d.mts +1 -1
  14. package/dist/parse-ast-index.d.mts +1 -1
  15. package/dist/parse-ast-index.mjs +2 -2
  16. package/dist/plugins-index.d.mts +3 -3
  17. package/dist/plugins-index.mjs +2 -2
  18. package/dist/shared/{binding-DamCAbY6.mjs → binding-9kL0gFYL.mjs} +28 -27
  19. package/dist/shared/{binding-DE7ERejD.d.mts → binding-CckXxUel.d.mts} +53 -4
  20. package/dist/shared/{bindingify-input-options-SGSGV3Kn.mjs → bindingify-input-options-3NuL6LmT.mjs} +35 -21
  21. package/dist/shared/{constructors-CTfc5fh7.mjs → constructors-BR7PP67a.mjs} +1 -1
  22. package/dist/shared/{constructors-CqnDcrIL.d.mts → constructors-CZDP-zxV.d.mts} +2 -2
  23. package/dist/shared/{define-config-xmEHQczI.d.mts → define-config-BdEm3DW7.d.mts} +108 -12
  24. package/dist/shared/dist-DKbukT1H.mjs +154 -0
  25. package/dist/shared/{error-BmTEI0xY.mjs → error-D2KvICgd.mjs} +1 -1
  26. package/dist/shared/{get-log-filter-BpNVNJ5-.d.mts → get-log-filter-B4LpBryx.d.mts} +2 -2
  27. package/dist/shared/{load-config-DY5kAiwf.mjs → load-config-C-H6Sxai.mjs} +19 -2
  28. package/dist/shared/{logs-aMKUxRpj.mjs → logs-ZGEh6uhb.mjs} +6 -1
  29. package/dist/shared/{normalize-string-or-regex-Ddbkskw6.mjs → normalize-string-or-regex-BzQ-7a-8.mjs} +2 -2
  30. package/dist/shared/{parse-CNsctGYH.mjs → parse-CanHtd_6.mjs} +2 -2
  31. package/dist/shared/{prompt-B1Yc1NPt.mjs → prompt--dNycKSZ.mjs} +59 -17
  32. package/dist/shared/{resolve-tsconfig-B6udNjE_.mjs → resolve-tsconfig-Bx74P5AA.mjs} +2 -2
  33. package/dist/shared/{rolldown-C6DTtWMe.mjs → rolldown-BCi17Yn9.mjs} +2 -2
  34. package/dist/shared/{rolldown-build-BCVOvLca.mjs → rolldown-build-BjB3v1c2.mjs} +43 -17
  35. package/dist/shared/{transform-DiNoOk6R.d.mts → transform-C20O3Ind.d.mts} +1 -1
  36. package/dist/shared/{watch-BqeQlZnt.mjs → watch-BilISOyp.mjs} +6 -6
  37. package/dist/utils-index.d.mts +5 -5
  38. package/dist/utils-index.mjs +10 -8
  39. package/package.json +14 -13
package/dist/cli.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { n as onExit, t as watch } from "./shared/watch-BqeQlZnt.mjs";
2
- import { C as version, S as description } from "./shared/bindingify-input-options-SGSGV3Kn.mjs";
1
+ import { n as onExit, t as watch } from "./shared/watch-BilISOyp.mjs";
2
+ import { S as version, x as description } from "./shared/bindingify-input-options-3NuL6LmT.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-BCVOvLca.mjs";
5
- import { t as rolldown } from "./shared/rolldown-C6DTtWMe.mjs";
6
- import { t as loadConfig } from "./shared/load-config-DY5kAiwf.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-BjB3v1c2.mjs";
5
+ import { t as rolldown } from "./shared/rolldown-BCi17Yn9.mjs";
6
+ import { t as loadConfig } from "./shared/load-config-C-H6Sxai.mjs";
7
7
  import path from "node:path";
8
8
  import g$1 from "node:process";
9
9
  import { performance } from "node:perf_hooks";
@@ -631,6 +631,7 @@ const alias = {
631
631
  abbreviation: "c",
632
632
  hint: "filename"
633
633
  },
634
+ configLoader: { hint: "loader" },
634
635
  help: { abbreviation: "h" },
635
636
  version: { abbreviation: "v" },
636
637
  watch: { abbreviation: "w" },
@@ -684,7 +685,8 @@ const reservedKeys = /* @__PURE__ */ new Set([
684
685
  "version",
685
686
  "config",
686
687
  "watch",
687
- "environment"
688
+ "environment",
689
+ "configLoader"
688
690
  ]);
689
691
  function normalizeCliOptions(cliOptions, positionals) {
690
692
  const [data, errors] = validateCliOptions(cliOptions);
@@ -705,6 +707,7 @@ function normalizeCliOptions(cliOptions, positionals) {
705
707
  if (typeof options.config === "string") result.config = options.config;
706
708
  else if (options.config === true) result.config = "";
707
709
  if (options.environment !== void 0) result.environment = options.environment;
710
+ if (options.configLoader !== void 0) result.configLoader = options.configLoader;
708
711
  const keysOfInput = new Set(getInputCliKeys());
709
712
  const keysOfOutput = new Set(getOutputCliKeys());
710
713
  for (let [key, value] of Object.entries(options)) {
@@ -859,7 +862,7 @@ function getClearScreenFunction(options) {
859
862
  };
860
863
  }
861
864
  //#endregion
862
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/usingCtx.js
865
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/usingCtx.js
863
866
  function _usingCtx() {
864
867
  var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
865
868
  var n = Error();
@@ -921,7 +924,7 @@ async function bundleWithConfig(configPath, cliOptions, rawArgs = {}) {
921
924
  process.env.ROLLUP_WATCH = "true";
922
925
  process.env.ROLLDOWN_WATCH = "true";
923
926
  }
924
- const config = await loadConfig(configPath);
927
+ const config = await loadConfig(configPath, { configLoader: cliOptions.configLoader });
925
928
  const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
926
929
  if (typeof resolvedConfig !== "object" || resolvedConfig === null) {
927
930
  logger.error(`Invalid configuration from ${configPath}: expected object or array, got ${resolvedConfig}`);
package/dist/config.d.mts CHANGED
@@ -1,14 +1,27 @@
1
- import { I as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-xmEHQczI.mjs";
1
+ import { L as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-BdEm3DW7.mjs";
2
2
 
3
3
  //#region src/utils/load-config.d.ts
4
+ type ConfigLoader = "bundle" | "native";
5
+ interface LoadConfigOptions {
6
+ /**
7
+ * How to load the config file.
8
+ * - `'bundle'` (default): bundle the config with Rolldown, then import it.
9
+ * - `'native'`: import the config directly, delegating TypeScript/loader
10
+ * handling to the runtime. Faster, but requires runtime support.
11
+ *
12
+ * @default 'bundle'
13
+ */
14
+ configLoader?: ConfigLoader;
15
+ }
4
16
  /**
5
17
  * Load config from a file in a way that Rolldown does.
6
18
  *
7
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'`.
8
21
  * @returns The loaded config export
9
22
  *
10
23
  * @category Config
11
24
  */
12
- declare function loadConfig(configPath: string): Promise<ConfigExport>;
25
+ declare function loadConfig(configPath: string, options?: LoadConfigOptions): Promise<ConfigExport>;
13
26
  //#endregion
14
27
  export { VERSION, defineConfig, loadConfig };
package/dist/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { x as VERSION } from "./shared/bindingify-input-options-SGSGV3Kn.mjs";
1
+ import { b as VERSION } from "./shared/bindingify-input-options-3NuL6LmT.mjs";
2
2
  import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
3
- import { t as loadConfig } from "./shared/load-config-DY5kAiwf.mjs";
3
+ import { t as loadConfig } from "./shared/load-config-C-H6Sxai.mjs";
4
4
  export { VERSION, defineConfig, loadConfig };
@@ -1,7 +1,7 @@
1
- import { A as BindingViteTransformPluginConfig, J as isolatedDeclaration, N as IsolatedDeclarationsOptions, P as IsolatedDeclarationsResult, R as NapiResolveOptions, T as BindingViteManifestPluginConfig, U as ResolveResult, W as ResolverFactory, X as moduleRunnerTransform, Y as isolatedDeclarationSync, f as BindingRebuildStrategy, g as BindingRollipopReactRefreshWrapperPluginConfig, h as BindingRollipopReactNativeTransformResult, i as BindingClientHmrUpdate, n as BindingBundleAnalyzerPluginConfig, r as BindingBundleState, v as BindingTsconfigCompilerOptions, y as BindingTsconfigRawOptions } from "./shared/binding-DE7ERejD.mjs";
2
- import { Jt as RolldownOutput, P as BuiltinPlugin, Ut as StringOrRegExp, Xt as freeExternalMemory, Z as defineParallelPlugin, ct as NormalizedOutputOptions, l as InputOptions, zt as OutputOptions } from "./shared/define-config-xmEHQczI.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-DiNoOk6R.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-CqnDcrIL.mjs";
1
+ import { $ as moduleRunnerTransform, A as BindingViteTransformPluginConfig, G as ResolverFactory, N as IsolatedDeclarationsOptions, P as IsolatedDeclarationsResult, Q as isolatedDeclarationSync, R as NapiResolveOptions, T as BindingViteManifestPluginConfig, W as ResolveResult, X as clearCacheById, Y as clearCache, Z as isolatedDeclaration, f as BindingRebuildStrategy, g as BindingRollipopReactRefreshWrapperPluginConfig, h as BindingRollipopReactNativeTransformResult, i as BindingClientHmrUpdate, n as BindingBundleAnalyzerPluginConfig, r as BindingBundleState, v as BindingTsconfigCompilerOptions, y as BindingTsconfigRawOptions } from "./shared/binding-CckXxUel.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-BdEm3DW7.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-C20O3Ind.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-CZDP-zxV.mjs";
5
5
 
6
6
  //#region src/api/dev/dev-options.d.ts
7
7
  type DevOnHmrUpdates = (result: Error | {
@@ -159,7 +159,7 @@ declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
159
159
  *
160
160
  * @example
161
161
  * ```js
162
- * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
162
+ * import { bundleAnalyzerPlugin } from '@rollipop/rolldown/experimental';
163
163
  *
164
164
  * export default {
165
165
  * plugins: [
@@ -171,7 +171,7 @@ declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
171
171
  * @example
172
172
  * **Custom filename**
173
173
  * ```js
174
- * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
174
+ * import { bundleAnalyzerPlugin } from '@rollipop/rolldown/experimental';
175
175
  *
176
176
  * export default {
177
177
  * plugins: [
@@ -185,7 +185,7 @@ declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
185
185
  * @example
186
186
  * **LLM-friendly markdown output**
187
187
  * ```js
188
- * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
188
+ * import { bundleAnalyzerPlugin } from '@rollipop/rolldown/experimental';
189
189
  *
190
190
  * export default {
191
191
  * plugins: [
@@ -417,4 +417,4 @@ type TsconfigRawOptions = BindingTsconfigRawOptions;
417
417
  /** @deprecated Use from `rolldown/utils` instead. */
418
418
  type TsconfigCompilerOptions = BindingTsconfigCompilerOptions;
419
419
  //#endregion
420
- export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, MinifyOptions, MinifyResult, ParseResult, ParserOptions, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type RollipopReactNativeFlowConfig, type RollipopReactNativeModuleConfig, type RollipopReactNativeModuleType, type RollipopReactNativePluginConfig, type RollipopReactNativeReactConfig, type RollipopReactNativeRuntimeTarget, type RollipopReactNativeSwcConfig, type RollipopReactNativeTransformResult, RollipopReactNativeTransformer, type RollipopReactNativeTransformerConfig, type RollipopReactNativeWorkletsConfig, type BindingRollipopReactRefreshWrapperPluginConfig as RollipopReactRefreshWrapperPluginConfig, TransformOptions, TransformResult, TsconfigCache, TsconfigCompilerOptions, TsconfigRawOptions, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, rollipopReactNativePlugin, rollipopReactRefreshWrapperPlugin, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWebWorkerPostPlugin };
420
+ export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, MinifyOptions, MinifyResult, ParseResult, ParserOptions, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type RollipopReactNativeFlowConfig, type RollipopReactNativeModuleConfig, type RollipopReactNativeModuleType, type RollipopReactNativePluginConfig, type RollipopReactNativeReactConfig, type RollipopReactNativeRuntimeTarget, type RollipopReactNativeSwcConfig, type RollipopReactNativeTransformResult, RollipopReactNativeTransformer, type RollipopReactNativeTransformerConfig, type RollipopReactNativeWorkletsConfig, type BindingRollipopReactRefreshWrapperPluginConfig as RollipopReactRefreshWrapperPluginConfig, TransformOptions, TransformResult, TsconfigCache, TsconfigCompilerOptions, TsconfigRawOptions, bundleAnalyzerPlugin, clearCache, clearCacheById, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, rollipopReactNativePlugin, rollipopReactRefreshWrapperPlugin, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWebWorkerPostPlugin };
@@ -1,11 +1,11 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-DamCAbY6.mjs";
2
- import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-Ddbkskw6.mjs";
3
- import { o as transformToRollupOutput } from "./shared/bindingify-input-options-SGSGV3Kn.mjs";
4
- import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-BCVOvLca.mjs";
5
- import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-BmTEI0xY.mjs";
6
- import { n as parseSync$1, t as parse$1 } from "./shared/parse-CNsctGYH.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-CTfc5fh7.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-B6udNjE_.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-9kL0gFYL.mjs";
2
+ import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-BzQ-7a-8.mjs";
3
+ import { o as transformToRollupOutput } from "./shared/bindingify-input-options-3NuL6LmT.mjs";
4
+ import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-BjB3v1c2.mjs";
5
+ import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-D2KvICgd.mjs";
6
+ import { n as parseSync$1, t as parse$1 } from "./shared/parse-CanHtd_6.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-BR7PP67a.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-Bx74P5AA.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);
@@ -57,7 +57,8 @@ var DevEngine = class DevEngine {
57
57
  exclude: normalizedStringOrRegex(devOptions.watch.exclude)
58
58
  }
59
59
  };
60
- return new DevEngine(new import_binding.BindingDevEngine(options.bundlerOptions, bindingDevOptions));
60
+ const inner = new import_binding.BindingDevEngine(options.bundlerOptions, bindingDevOptions);
61
+ return new DevEngine(inner);
61
62
  }
62
63
  constructor(inner) {
63
64
  this.#inner = inner;
@@ -220,7 +221,7 @@ function viteAliasPlugin(config) {
220
221
  *
221
222
  * @example
222
223
  * ```js
223
- * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
224
+ * import { bundleAnalyzerPlugin } from '@rollipop/rolldown/experimental';
224
225
  *
225
226
  * export default {
226
227
  * plugins: [
@@ -232,7 +233,7 @@ function viteAliasPlugin(config) {
232
233
  * @example
233
234
  * **Custom filename**
234
235
  * ```js
235
- * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
236
+ * import { bundleAnalyzerPlugin } from '@rollipop/rolldown/experimental';
236
237
  *
237
238
  * export default {
238
239
  * plugins: [
@@ -246,7 +247,7 @@ function viteAliasPlugin(config) {
246
247
  * @example
247
248
  * **LLM-friendly markdown output**
248
249
  * ```js
249
- * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
250
+ * import { bundleAnalyzerPlugin } from '@rollipop/rolldown/experimental';
250
251
  *
251
252
  * export default {
252
253
  * plugins: [
@@ -402,7 +403,9 @@ const TsconfigCache = TsconfigCache$1;
402
403
  //#endregion
403
404
  var BindingRebuildStrategy = import_binding.BindingRebuildStrategy;
404
405
  var ResolverFactory = import_binding.ResolverFactory;
406
+ var clearCache = import_binding.clearCache;
407
+ var clearCacheById = import_binding.clearCacheById;
405
408
  var isolatedDeclaration = import_binding.isolatedDeclaration;
406
409
  var isolatedDeclarationSync = import_binding.isolatedDeclarationSync;
407
410
  var moduleRunnerTransform = import_binding.moduleRunnerTransform;
408
- export { BindingRebuildStrategy, DevEngine, ResolverFactory, RollipopReactNativeTransformer, TsconfigCache, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, rollipopReactNativePlugin, rollipopReactRefreshWrapperPlugin, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWebWorkerPostPlugin };
411
+ export { BindingRebuildStrategy, DevEngine, ResolverFactory, RollipopReactNativeTransformer, TsconfigCache, bundleAnalyzerPlugin, clearCache, clearCacheById, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, rollipopReactNativePlugin, rollipopReactRefreshWrapperPlugin, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWebWorkerPostPlugin };
@@ -1,4 +1,4 @@
1
- import { N as withFilter } from "./shared/define-config-xmEHQczI.mjs";
1
+ import { P as withFilter } from "./shared/define-config-BdEm3DW7.mjs";
2
2
 
3
3
  //#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.1/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts
4
4
  //#region src/filter/composable-filters.d.ts
@@ -347,8 +347,8 @@ function withFilterImpl(pluginOption, filterObjectList) {
347
347
  * @example
348
348
  * ```ts
349
349
  * import yaml from '@rollup/plugin-yaml';
350
- * import { defineConfig } from 'rolldown';
351
- * import { withFilter } from 'rolldown/filter';
350
+ * import { defineConfig } from '@rollipop/rolldown';
351
+ * import { withFilter } from '@rollipop/rolldown/filter';
352
352
  *
353
353
  * export default defineConfig({
354
354
  * plugins: [
@@ -1,3 +1,3 @@
1
1
  import { a as RolldownLog } from "./shared/logging-BSNejiLS.mjs";
2
- import { n as getLogFilter, t as GetLogFilter } from "./shared/get-log-filter-BpNVNJ5-.mjs";
2
+ import { n as getLogFilter, t as GetLogFilter } from "./shared/get-log-filter-B4LpBryx.mjs";
3
3
  export { GetLogFilter, type RolldownLog, type RolldownLog as RollupLog, getLogFilter as default };
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * @example
6
6
  * ```ts
7
- * import { defineConfig } from 'rolldown';
8
- * import { getLogFilter } from 'rolldown/getLogFilter';
7
+ * import { defineConfig } from '@rollipop/rolldown';
8
+ * import { getLogFilter } from '@rollipop/rolldown/getLogFilter';
9
9
  *
10
10
  * const logFilter = getLogFilter(['code:FOO', 'code:BAR']);
11
11
  *
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-BSNejiLS.mjs";
2
- import { H as PreRenderedChunk } from "./shared/binding-DE7ERejD.mjs";
3
- import { $ as PluginContextMeta, A as RolldownPluginOption, At as CodeSplittingGroup, B as OutputBundle, Bt as PreRenderedAsset, C as ParallelPluginHooks, Ct as build, D as ResolveIdResult, Dt as BuiltinModuleTag, E as ResolveIdExtraOptions, Et as AdvancedChunksOptions, F as RUNTIME_MODULE_ID, Ft as GeneratedCodePreset, G as EmittedFile, Gt as OutputChunk, H as TransformPluginContext, Ht as PartialNull, I as VERSION, It as GlobalsFunction, J as PluginContext, Jt as RolldownOutput, K as EmittedPrebuiltChunk, Kt as RenderedChunk, L as BundleError, Lt as MinifyOptions, M as TransformResult, Mt as CodeSplittingOptions, Nt as CommentsOptions, O as ResolvedId, Ot as ChunkFileNamesFunction, Pt as GeneratedCodeOptions, Q as MinimalPluginContext, Qt as SourcemapIgnoreListOption, R as ExistingRawSourceMap, Rt as ModuleFormat, S as ObjectHook, St as BuildOptions, T as Plugin, Tt as AdvancedChunksGroup, U as EmittedAsset, V as TreeshakingOptions, W as EmittedChunk, Wt as OutputAsset, X as DefineParallelPluginResult, Y as PluginContextResolveOptions, Yt as SourceMap, Zt as ModuleInfo, _ as HookFilterExtension, _t as RolldownWatcherEvent, a as ChunkOptimizationOptions, at as RolldownFileStats, b as ModuleOptions, bt as rolldown, c as InputOption, ct as NormalizedOutputOptions, d as OptimizationOptions, dt as ChecksOptions, et as GeneralHookFilter, f as WatcherFileWatcherOptions, ft as LoggingFunction, g as FunctionPluginHooks, gt as RolldownWatcher, h as CustomPluginOptions, ht as watch, i as RolldownOptions, it as RolldownDirectoryEntry, j as SourceDescription, jt as CodeSplittingNameFunction, k as RolldownPlugin, kt as ChunkingContext, l as InputOptions, lt as NormalizedInputOptions, m as AsyncPluginHooks, mt as RolldownMagicString, n as RolldownOptionsFunction, nt as ModuleTypeFilter, o as ExternalOption, ot as RolldownFsModule, p as WatcherOptions, pt as WarningHandlerWithDefault, q as GetModuleInfo, qt as RenderedModule, r as defineConfig, rt as BufferEncoding, s as ExternalOptionFunction, st as InternalModuleFormat, t as ConfigExport, tt as HookFilter, u as ModuleTypes, ut as TransformOptions, v as ImportKind, vt as RolldownWatcherWatcherEventMap, w as PartialResolvedId, wt as AddonFunction, x as ModuleType, xt as RolldownBuild, y as LoadResult, yt as WatchOptions, z as SourceMapInput, zt as OutputOptions } from "./shared/define-config-xmEHQczI.mjs";
4
- export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PluginContextResolveOptions, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
2
+ import { H as PreRenderedChunk } from "./shared/binding-CckXxUel.mjs";
3
+ import { $ as MinimalPluginContext, $t as SourcemapIgnoreListOption, A as RolldownPlugin, At as ChunkingContext, B as SourceMapInput, Bt as OutputOptions, C as ParallelPluginHooks, Ct as BuildOptions, D as ResolveIdExtraOptions, Dt as AdvancedChunksOptions, E as PluginMeta, Et as AdvancedChunksGroup, Ft as GeneratedCodeOptions, G as EmittedChunk, Gt as OutputAsset, H as TreeshakingOptions, I as RUNTIME_MODULE_ID, It as GeneratedCodePreset, J as GetModuleInfo, Jt as RenderedModule, K as EmittedFile, Kt as OutputChunk, L as VERSION, Lt as GlobalsFunction, M as SourceDescription, Mt as CodeSplittingNameFunction, N as TransformResult, Nt as CodeSplittingOptions, O as ResolveIdResult, Ot as BuiltinModuleTag, Pt as CommentsOptions, Qt as ModuleInfo, R as BundleError, Rt as MinifyOptions, S as ObjectHook, St as RolldownBuild, T as Plugin, Tt as AddonFunction, U as TransformPluginContext, Ut as PartialNull, V as OutputBundle, Vt as PreRenderedAsset, W as EmittedAsset, X as PluginContextResolveOptions, Xt as SourceMap, Y as PluginContext, Yt as RolldownOutput, Z as DefineParallelPluginResult, _ as HookFilterExtension, _t as RolldownWatcher, a as ChunkOptimizationOptions, at as RolldownDirectoryEntry, b as ModuleOptions, bt as WatchOptions, c as InputOption, ct as InternalModuleFormat, d as OptimizationOptions, dt as TransformOptions, et as PluginContextMeta, f as WatcherFileWatcherOptions, ft as ChecksOptions, g as FunctionPluginHooks, gt as watch, h as CustomPluginOptions, ht as RolldownMagicString, i as RolldownOptions, it as BufferEncoding, j as RolldownPluginOption, jt as CodeSplittingGroup, k as ResolvedId, kt as ChunkFileNamesFunction, l as InputOptions, lt as NormalizedOutputOptions, m as AsyncPluginHooks, mt as WarningHandlerWithDefault, n as RolldownOptionsFunction, nt as HookFilter, o as ExternalOption, ot as RolldownFileStats, p as WatcherOptions, pt as LoggingFunction, q as EmittedPrebuiltChunk, qt as RenderedChunk, r as defineConfig, rt as ModuleTypeFilter, s as ExternalOptionFunction, st as RolldownFsModule, t as ConfigExport, tt as GeneralHookFilter, u as ModuleTypes, ut as NormalizedInputOptions, v as ImportKind, vt as RolldownWatcherEvent, w as PartialResolvedId, wt as build, x as ModuleType, xt as rolldown, y as LoadResult, yt as RolldownWatcherWatcherEventMap, z as ExistingRawSourceMap, zt as ModuleFormat } from "./shared/define-config-BdEm3DW7.mjs";
4
+ export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PluginContextResolveOptions, type PluginMeta, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-DamCAbY6.mjs";
2
- import { n as onExit, t as watch } from "./shared/watch-BqeQlZnt.mjs";
3
- import { b as RUNTIME_MODULE_ID, r as RolldownMagicString, x as VERSION } from "./shared/bindingify-input-options-SGSGV3Kn.mjs";
4
- import { t as rolldown } from "./shared/rolldown-C6DTtWMe.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-9kL0gFYL.mjs";
2
+ import { n as onExit, t as watch } from "./shared/watch-BilISOyp.mjs";
3
+ import { b as VERSION, r as RolldownMagicString } from "./shared/bindingify-input-options-3NuL6LmT.mjs";
4
+ import { t as rolldown } from "./shared/rolldown-BCi17Yn9.mjs";
5
5
  import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
6
6
  import { isMainThread } from "node:worker_threads";
7
7
  //#region src/setup.ts
@@ -13,13 +13,19 @@ if (isMainThread) {
13
13
  });
14
14
  }
15
15
  //#endregion
16
+ //#region src/constants/index.ts
17
+ /**
18
+ * Runtime helper module ID
19
+ */
20
+ const RUNTIME_MODULE_ID = "\0rolldown/runtime.js";
21
+ //#endregion
16
22
  //#region src/api/build.ts
17
23
  /**
18
24
  * The API similar to esbuild's `build` function.
19
25
  *
20
26
  * @example
21
27
  * ```js
22
- * import { build } from 'rolldown';
28
+ * import { build } from '@rollipop/rolldown';
23
29
  *
24
30
  * const result = await build({
25
31
  * input: 'src/main.js',
@@ -1,19 +1,20 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-DamCAbY6.mjs";
2
- import { i as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-SGSGV3Kn.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-9kL0gFYL.mjs";
2
+ import { i as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-3NuL6LmT.mjs";
3
3
  import { parentPort, workerData } from "node:worker_threads";
4
4
  //#region src/parallel-plugin-worker.ts
5
5
  var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
6
6
  const { registryId, pluginInfos, threadNumber } = workerData;
7
7
  (async () => {
8
8
  try {
9
- (0, import_binding.registerPlugins)(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
9
+ const plugins = await Promise.all(pluginInfos.map(async (pluginInfo) => {
10
10
  const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
11
11
  const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
12
12
  return {
13
13
  index: pluginInfo.index,
14
14
  plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, [], []), [], () => {}, "info", false)
15
15
  };
16
- })));
16
+ }));
17
+ (0, import_binding.registerPlugins)(registryId, plugins);
17
18
  parentPort.postMessage({ type: "success" });
18
19
  } catch (error) {
19
20
  parentPort.postMessage({
@@ -1,4 +1,4 @@
1
- import { T as Plugin, Vt as MaybePromise } from "./shared/define-config-xmEHQczI.mjs";
1
+ import { Ht as MaybePromise, T as Plugin } from "./shared/define-config-BdEm3DW7.mjs";
2
2
 
3
3
  //#region src/plugin/parallel-plugin-implementation.d.ts
4
4
  type ParallelPluginImplementation = Plugin;
@@ -1,4 +1,4 @@
1
- import { B as ParseResult$1, V as ParserOptions$1 } from "./shared/binding-DE7ERejD.mjs";
1
+ import { B as ParseResult$1, V as ParserOptions$1 } from "./shared/binding-CckXxUel.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
 
4
4
  //#region src/parse-ast-index.d.ts
@@ -1,5 +1,5 @@
1
- import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-aMKUxRpj.mjs";
2
- import { n as parseSync, t as parse } from "./shared/parse-CNsctGYH.mjs";
1
+ import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-ZGEh6uhb.mjs";
2
+ import { n as parseSync, t as parse } from "./shared/parse-CanHtd_6.mjs";
3
3
  //#region src/parse-ast-index.ts
4
4
  function wrap(result, filename, sourceText) {
5
5
  if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
@@ -1,6 +1,6 @@
1
- import { m as BindingReplacePluginConfig } from "./shared/binding-DE7ERejD.mjs";
2
- import { P as BuiltinPlugin } from "./shared/define-config-xmEHQczI.mjs";
3
- import { t as esmExternalRequirePlugin } from "./shared/constructors-CqnDcrIL.mjs";
1
+ import { m as BindingReplacePluginConfig } from "./shared/binding-CckXxUel.mjs";
2
+ import { F as BuiltinPlugin } from "./shared/define-config-BdEm3DW7.mjs";
3
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-CZDP-zxV.mjs";
4
4
 
5
5
  //#region src/builtin-plugin/replace-plugin.d.ts
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-Ddbkskw6.mjs";
2
- import { t as esmExternalRequirePlugin } from "./shared/constructors-CTfc5fh7.mjs";
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-BzQ-7a-8.mjs";
2
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-BR7PP67a.mjs";
3
3
  //#region src/builtin-plugin/replace-plugin.ts
4
4
  /**
5
5
  * Replaces targeted strings in files while bundling.