@rolldown/browser 1.0.0-beta.8-commit.a98d94e → 1.0.0-beta.8-commit.baf6ca1

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 (35) hide show
  1. package/dist/browser.mjs +343 -188
  2. package/dist/cli.cjs +8 -7
  3. package/dist/cli.mjs +4 -3
  4. package/dist/experimental-index.cjs +3 -2
  5. package/dist/experimental-index.d.cts +1 -1
  6. package/dist/experimental-index.d.mts +1 -1
  7. package/dist/experimental-index.mjs +3 -2
  8. package/dist/filter-index.cjs +12 -0
  9. package/dist/filter-index.d.cts +3 -0
  10. package/dist/filter-index.d.mts +3 -0
  11. package/dist/filter-index.mjs +4 -0
  12. package/dist/index.cjs +4 -4
  13. package/dist/index.d.cts +2 -2
  14. package/dist/index.d.mts +2 -2
  15. package/dist/index.mjs +4 -3
  16. package/dist/parallel-plugin-worker.cjs +3 -2
  17. package/dist/parallel-plugin-worker.mjs +3 -2
  18. package/dist/parallel-plugin.d.cts +1 -1
  19. package/dist/parallel-plugin.d.mts +1 -1
  20. package/dist/parse-ast-index.cjs +1 -1
  21. package/dist/parse-ast-index.mjs +1 -1
  22. package/dist/rolldown-binding.wasi-browser.js +1 -0
  23. package/dist/rolldown-binding.wasi.cjs +1 -0
  24. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  25. package/dist/shared/filter-index-ChddWdsi.cjs +255 -0
  26. package/dist/shared/filter-index-DmisSKZF.mjs +174 -0
  27. package/dist/shared/{input-options.d-CMFIv0CX.d.mts → input-options.d-9IzFBPMw.d.mts} +82 -23
  28. package/dist/shared/{input-options.d-P0YdGzip.d.cts → input-options.d-BFt2wKBM.d.cts} +82 -23
  29. package/dist/shared/{src-D9guL4ht.mjs → src-DN1_B1_m.mjs} +1783 -1740
  30. package/dist/shared/{src-CJ9XODOK.cjs → src-glXqJCVJ.cjs} +260 -219
  31. package/package.json +1 -1
  32. /package/dist/shared/{parse-ast-index-DWHg_E7J.mjs → parse-ast-index-B5wGnMSg.mjs} +0 -0
  33. /package/dist/shared/{parse-ast-index-B9pj8J1q.cjs → parse-ast-index-DTWvag1h.cjs} +0 -0
  34. /package/dist/shared/{prompt-_yrURmmm.cjs → prompt-At99RuKY.cjs} +0 -0
  35. /package/dist/shared/{prompt-B7SnYdwU.mjs → prompt-BqVpALUY.mjs} +0 -0
package/dist/cli.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
2
- const require_src = require('./shared/src-CJ9XODOK.cjs');
3
- require('./shared/parse-ast-index-B9pj8J1q.cjs');
2
+ const require_src = require('./shared/src-glXqJCVJ.cjs');
3
+ const require_filter_index = require('./shared/filter-index-ChddWdsi.cjs');
4
+ require('./shared/parse-ast-index-DTWvag1h.cjs');
4
5
  const node_path = require_chunk.__toESM(require("node:path"));
5
6
  const ansis = require_chunk.__toESM(require("ansis"));
6
7
  const node_process = require_chunk.__toESM(require("node:process"));
@@ -970,7 +971,7 @@ function createConsola(options$1 = {}) {
970
971
  // Terminus (<0.2.27)
971
972
  // ConEmu and cmder
972
973
  function() {
973
- return require("./shared/prompt-_yrURmmm.cjs");
974
+ return require("./shared/prompt-At99RuKY.cjs");
974
975
  }
975
976
  ).then((m) => m.prompt(...args)),
976
977
  reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
@@ -1663,11 +1664,11 @@ async function bundleWithCliOptions(cliOptions) {
1663
1664
  }
1664
1665
  }
1665
1666
  async function watchInner(config, cliOptions) {
1666
- let normalizedConfig = require_src.arraify(config).map((option) => {
1667
+ let normalizedConfig = require_filter_index.arraify(config).map((option) => {
1667
1668
  return {
1668
1669
  ...option,
1669
1670
  ...cliOptions.input,
1670
- output: require_src.arraify(option.output || {}).map((output) => {
1671
+ output: require_filter_index.arraify(option.output || {}).map((output) => {
1671
1672
  return {
1672
1673
  ...output,
1673
1674
  ...cliOptions.output
@@ -1706,9 +1707,9 @@ async function watchInner(config, cliOptions) {
1706
1707
  async function bundleInner(config, cliOptions) {
1707
1708
  const startTime = node_perf_hooks.performance.now();
1708
1709
  const result = [];
1709
- const configList = require_src.arraify(config);
1710
+ const configList = require_filter_index.arraify(config);
1710
1711
  for (const config$1 of configList) {
1711
- const outputList = require_src.arraify(config$1.output || {});
1712
+ const outputList = require_filter_index.arraify(config$1.output || {});
1712
1713
  const build = await require_src.rolldown({
1713
1714
  ...config$1,
1714
1715
  ...cliOptions.input
package/dist/cli.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { __commonJS, __esm, __toESM } from "./shared/chunk-DSsiIF1Z.mjs";
2
- import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_misc, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-D9guL4ht.mjs";
3
- import "./shared/parse-ast-index-DWHg_E7J.mjs";
2
+ import { description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-DN1_B1_m.mjs";
3
+ import { arraify, init_misc } from "./shared/filter-index-DmisSKZF.mjs";
4
+ import "./shared/parse-ast-index-B5wGnMSg.mjs";
4
5
  import path, { sep } from "node:path";
5
6
  import colors from "ansis";
6
7
  import process$1, { cwd } from "node:process";
@@ -760,7 +761,7 @@ function createConsola(options$1 = {}) {
760
761
  defaults: { level },
761
762
  stdout: process.stdout,
762
763
  stderr: process.stderr,
763
- prompt: (...args) => import("./shared/prompt-B7SnYdwU.mjs").then((m) => m.prompt(...args)),
764
+ prompt: (...args) => import("./shared/prompt-BqVpALUY.mjs").then((m) => m.prompt(...args)),
764
765
  reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
765
766
  ...options$1
766
767
  });
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('./shared/src-CJ9XODOK.cjs');
4
- require('./shared/parse-ast-index-B9pj8J1q.cjs');
3
+ const require_src = require('./shared/src-glXqJCVJ.cjs');
4
+ require('./shared/filter-index-ChddWdsi.cjs');
5
+ require('./shared/parse-ast-index-DTWvag1h.cjs');
5
6
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
6
7
  const node_url = require_chunk.__toESM(require("node:url"));
7
8
 
@@ -1,4 +1,4 @@
1
- import { BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/input-options.d-P0YdGzip.cjs";
1
+ import { BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/input-options.d-BFt2wKBM.cjs";
2
2
  import { BindingReplacePluginConfig, BindingTransformPluginConfig, TransformOptions, TransformResult, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
3
3
 
4
4
  //#region src/api/experimental.d.ts
@@ -1,4 +1,4 @@
1
- import { BuiltinPlugin$1 as BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin$1 as buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin$1 as dynamicImportVarsPlugin, importGlobPlugin$1 as importGlobPlugin, isolatedDeclarationPlugin$1 as isolatedDeclarationPlugin, jsonPlugin$1 as jsonPlugin, loadFallbackPlugin$1 as loadFallbackPlugin, manifestPlugin$1 as manifestPlugin, moduleFederationPlugin$1 as moduleFederationPlugin, modulePreloadPolyfillPlugin$1 as modulePreloadPolyfillPlugin, reportPlugin$1 as reportPlugin, viteResolvePlugin$1 as viteResolvePlugin, wasmFallbackPlugin$1 as wasmFallbackPlugin, wasmHelperPlugin$1 as wasmHelperPlugin } from "./shared/input-options.d-CMFIv0CX.mjs";
1
+ import { BuiltinPlugin$1 as BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin$1 as buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin$1 as dynamicImportVarsPlugin, importGlobPlugin$1 as importGlobPlugin, isolatedDeclarationPlugin$1 as isolatedDeclarationPlugin, jsonPlugin$1 as jsonPlugin, loadFallbackPlugin$1 as loadFallbackPlugin, manifestPlugin$1 as manifestPlugin, moduleFederationPlugin$1 as moduleFederationPlugin, modulePreloadPolyfillPlugin$1 as modulePreloadPolyfillPlugin, reportPlugin$1 as reportPlugin, viteResolvePlugin$1 as viteResolvePlugin, wasmFallbackPlugin$1 as wasmFallbackPlugin, wasmHelperPlugin$1 as wasmHelperPlugin } from "./shared/input-options.d-9IzFBPMw.mjs";
2
2
  import { BindingReplacePluginConfig, BindingTransformPluginConfig, TransformOptions, TransformResult, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
3
3
 
4
4
  //#region src/api/experimental.d.ts
@@ -1,5 +1,6 @@
1
- import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_normalize_string_or_regex, init_transform_to_rollup_output, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/src-D9guL4ht.mjs";
2
- import "./shared/parse-ast-index-DWHg_E7J.mjs";
1
+ import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_normalize_string_or_regex, init_transform_to_rollup_output, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/src-DN1_B1_m.mjs";
2
+ import "./shared/filter-index-DmisSKZF.mjs";
3
+ import "./shared/parse-ast-index-B5wGnMSg.mjs";
3
4
  import { moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
4
5
  import { pathToFileURL } from "node:url";
5
6
 
@@ -0,0 +1,12 @@
1
+ const require_filter_index = require('./shared/filter-index-ChddWdsi.cjs');
2
+
3
+ exports.And = require_filter_index.And
4
+ exports.and = require_filter_index.and
5
+ exports.code = require_filter_index.code
6
+ exports.exclude = require_filter_index.exclude
7
+ exports.id = require_filter_index.id
8
+ exports.include = require_filter_index.include
9
+ exports.moduleType = require_filter_index.moduleType
10
+ exports.not = require_filter_index.not
11
+ exports.or = require_filter_index.or
12
+ exports.withFilter = require_filter_index.withFilter
@@ -0,0 +1,3 @@
1
+ import { And, FilterExpression, FilterExpressionKind, TopLevelFilterExpression, and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/input-options.d-BFt2wKBM.cjs";
2
+
3
+ export { And, FilterExpression, FilterExpressionKind, TopLevelFilterExpression, and, code, exclude, id, include, moduleType, not, or, withFilter };
@@ -0,0 +1,3 @@
1
+ import { And$1 as And, FilterExpression, FilterExpressionKind, TopLevelFilterExpression, and$1 as and, code$1 as code, exclude$1 as exclude, id$1 as id, include$1 as include, moduleType$1 as moduleType, not$1 as not, or$1 as or, withFilter$1 as withFilter } from "./shared/input-options.d-9IzFBPMw.mjs";
2
+
3
+ export { And, FilterExpression, FilterExpressionKind, TopLevelFilterExpression, and, code, exclude, id, include, moduleType, not, or, withFilter };
@@ -0,0 +1,4 @@
1
+ import { And, and, code, exclude, id, include, init_filter_index, moduleType, not, or, withFilter } from "./shared/filter-index-DmisSKZF.mjs";
2
+
3
+ init_filter_index();
4
+ export { And, and, code, exclude, id, include, moduleType, not, or, withFilter };
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
- const require_src = require('./shared/src-CJ9XODOK.cjs');
2
- require('./shared/parse-ast-index-B9pj8J1q.cjs');
1
+ const require_src = require('./shared/src-glXqJCVJ.cjs');
2
+ require('./shared/filter-index-ChddWdsi.cjs');
3
+ require('./shared/parse-ast-index-DTWvag1h.cjs');
3
4
 
4
5
  exports.VERSION = require_src.VERSION
5
6
  exports.build = require_src.build
6
7
  exports.defineConfig = require_src.defineConfig
7
8
  exports.rolldown = require_src.rolldown
8
- exports.watch = require_src.watch
9
- exports.withFilter = require_src.withFilter
9
+ exports.watch = require_src.watch
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, StringFilter, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch, withFilter } from "./shared/input-options.d-P0YdGzip.cjs";
1
+ import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch } from "./shared/input-options.d-BFt2wKBM.cjs";
2
2
 
3
- export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, StringFilter, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch, withFilter };
3
+ export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, StringFilter, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION$1 as VERSION, WarningHandlerWithDefault, WatchOptions, build$1 as build, defineConfig$1 as defineConfig, rolldown$1 as rolldown, watch$1 as watch, withFilter$1 as withFilter } from "./shared/input-options.d-CMFIv0CX.mjs";
1
+ import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION$1 as VERSION, WarningHandlerWithDefault, WatchOptions, build$1 as build, defineConfig$1 as defineConfig, rolldown$1 as rolldown, watch$1 as watch } from "./shared/input-options.d-9IzFBPMw.mjs";
2
2
 
3
- export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, StringFilter, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch, withFilter };
3
+ export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch };
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { VERSION, build, defineConfig, init_src, rolldown, watch, withFilter } from "./shared/src-D9guL4ht.mjs";
2
- import "./shared/parse-ast-index-DWHg_E7J.mjs";
1
+ import { VERSION, build, defineConfig, init_src, rolldown, watch } from "./shared/src-DN1_B1_m.mjs";
2
+ import "./shared/filter-index-DmisSKZF.mjs";
3
+ import "./shared/parse-ast-index-B5wGnMSg.mjs";
3
4
 
4
5
  init_src();
5
- export { VERSION, build, defineConfig, rolldown, watch, withFilter };
6
+ export { VERSION, build, defineConfig, rolldown, watch };
@@ -1,6 +1,7 @@
1
1
  const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
2
- const require_src = require('./shared/src-CJ9XODOK.cjs');
3
- require('./shared/parse-ast-index-B9pj8J1q.cjs');
2
+ const require_src = require('./shared/src-glXqJCVJ.cjs');
3
+ require('./shared/filter-index-ChddWdsi.cjs');
4
+ require('./shared/parse-ast-index-DTWvag1h.cjs');
4
5
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
5
6
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
6
7
 
@@ -1,6 +1,7 @@
1
1
  import { __commonJS } from "./shared/chunk-DSsiIF1Z.mjs";
2
- import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-D9guL4ht.mjs";
3
- import "./shared/parse-ast-index-DWHg_E7J.mjs";
2
+ import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-DN1_B1_m.mjs";
3
+ import "./shared/filter-index-DmisSKZF.mjs";
4
+ import "./shared/parse-ast-index-B5wGnMSg.mjs";
4
5
  import { registerPlugins } from "./rolldown-binding.wasi.cjs";
5
6
  import { parentPort, workerData } from "node:worker_threads";
6
7
 
@@ -1,4 +1,4 @@
1
- import { MaybePromise, Plugin } from "./shared/input-options.d-P0YdGzip.cjs";
1
+ import { MaybePromise, Plugin } from "./shared/input-options.d-BFt2wKBM.cjs";
2
2
 
3
3
  //#region src/plugin/parallel-plugin-implementation.d.ts
4
4
  type ParallelPluginImplementation = Plugin;
@@ -1,4 +1,4 @@
1
- import { MaybePromise, Plugin } from "./shared/input-options.d-CMFIv0CX.mjs";
1
+ import { MaybePromise, Plugin } from "./shared/input-options.d-9IzFBPMw.mjs";
2
2
 
3
3
  //#region src/plugin/parallel-plugin-implementation.d.ts
4
4
  type ParallelPluginImplementation = Plugin;
@@ -1,4 +1,4 @@
1
- const require_parse_ast_index = require('./shared/parse-ast-index-B9pj8J1q.cjs');
1
+ const require_parse_ast_index = require('./shared/parse-ast-index-DTWvag1h.cjs');
2
2
 
3
3
  exports.parseAst = require_parse_ast_index.parseAst
4
4
  exports.parseAstAsync = require_parse_ast_index.parseAstAsync
@@ -1,4 +1,4 @@
1
- import { init_parse_ast_index, parseAst, parseAstAsync } from "./shared/parse-ast-index-DWHg_E7J.mjs";
1
+ import { init_parse_ast_index, parseAst, parseAstAsync } from "./shared/parse-ast-index-B5wGnMSg.mjs";
2
2
 
3
3
  init_parse_ast_index();
4
4
  export { parseAst, parseAstAsync };
@@ -86,6 +86,7 @@ export const BindingPluginOrder = __napiModule.exports.BindingPluginOrder
86
86
  export const ExportExportNameKind = __napiModule.exports.ExportExportNameKind
87
87
  export const ExportImportNameKind = __napiModule.exports.ExportImportNameKind
88
88
  export const ExportLocalNameKind = __napiModule.exports.ExportLocalNameKind
89
+ export const FilterTokenKind = __napiModule.exports.FilterTokenKind
89
90
  export const getBufferOffset = __napiModule.exports.getBufferOffset
90
91
  export const HelperMode = __napiModule.exports.HelperMode
91
92
  export const ImportNameKind = __napiModule.exports.ImportNameKind
@@ -111,6 +111,7 @@ module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder
111
111
  module.exports.ExportExportNameKind = __napiModule.exports.ExportExportNameKind
112
112
  module.exports.ExportImportNameKind = __napiModule.exports.ExportImportNameKind
113
113
  module.exports.ExportLocalNameKind = __napiModule.exports.ExportLocalNameKind
114
+ module.exports.FilterTokenKind = __napiModule.exports.FilterTokenKind
114
115
  module.exports.getBufferOffset = __napiModule.exports.getBufferOffset
115
116
  module.exports.HelperMode = __napiModule.exports.HelperMode
116
117
  module.exports.ImportNameKind = __napiModule.exports.ImportNameKind
@@ -0,0 +1,255 @@
1
+ "use strict";
2
+
3
+ //#region src/utils/misc.ts
4
+ function arraify(value) {
5
+ return Array.isArray(value) ? value : [value];
6
+ }
7
+ function isNullish(value) {
8
+ return value === null || value === void 0;
9
+ }
10
+ function isPromiseLike(value) {
11
+ return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
12
+ }
13
+ function unimplemented(info) {
14
+ if (info) throw new Error(`unimplemented: ${info}`);
15
+ throw new Error("unimplemented");
16
+ }
17
+ function unreachable(info) {
18
+ if (info) throw new Error(`unreachable: ${info}`);
19
+ throw new Error("unreachable");
20
+ }
21
+ function unsupported(info) {
22
+ throw new Error(`UNSUPPORTED: ${info}`);
23
+ }
24
+ function noop(..._args) {}
25
+
26
+ //#endregion
27
+ //#region src/plugin/with-filter.ts
28
+ function withFilterImpl(pluginOption, filterObjectList) {
29
+ if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
30
+ if (pluginOption == false || pluginOption == null) return pluginOption;
31
+ if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
32
+ let plugin = pluginOption;
33
+ let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
34
+ if (filterObjectIndex === -1) return plugin;
35
+ let filterObject = filterObjectList[filterObjectIndex];
36
+ Object.keys(plugin).forEach((key) => {
37
+ switch (key) {
38
+ case "transform":
39
+ case "resolveId":
40
+ case "load":
41
+ if (!plugin[key]) return;
42
+ if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
43
+ else plugin[key] = {
44
+ handler: plugin[key],
45
+ filter: filterObject[key]
46
+ };
47
+ break;
48
+ default: break;
49
+ }
50
+ });
51
+ return plugin;
52
+ }
53
+ function withFilter(pluginOption, filterObject) {
54
+ return withFilterImpl(pluginOption, arraify(filterObject));
55
+ }
56
+ function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
57
+ if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
58
+ for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
59
+ let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
60
+ if (typeof pattern === "string" && pattern === pluginName) return i;
61
+ else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
62
+ }
63
+ return -1;
64
+ }
65
+
66
+ //#endregion
67
+ //#region src/filter-index.ts
68
+ var And = class {
69
+ kind;
70
+ args;
71
+ constructor(...args) {
72
+ if (args.length === 0) throw new Error("`And` expects at least one operand");
73
+ this.args = args;
74
+ this.kind = "and";
75
+ }
76
+ };
77
+ var Or = class {
78
+ kind;
79
+ args;
80
+ constructor(...args) {
81
+ if (args.length === 0) throw new Error("`Or` expects at least one operand");
82
+ this.args = args;
83
+ this.kind = "or";
84
+ }
85
+ };
86
+ var Not = class {
87
+ kind;
88
+ expr;
89
+ constructor(expr) {
90
+ this.expr = expr;
91
+ this.kind = "not";
92
+ }
93
+ };
94
+ var Id = class {
95
+ kind;
96
+ pattern;
97
+ constructor(pattern) {
98
+ this.pattern = pattern;
99
+ this.kind = "id";
100
+ }
101
+ };
102
+ var ModuleType = class {
103
+ kind;
104
+ pattern;
105
+ constructor(pattern) {
106
+ this.pattern = pattern;
107
+ this.kind = "moduleType";
108
+ }
109
+ };
110
+ var Code = class {
111
+ kind;
112
+ pattern;
113
+ constructor(expr) {
114
+ this.pattern = expr;
115
+ this.kind = "code";
116
+ }
117
+ };
118
+ var Include = class {
119
+ kind;
120
+ expr;
121
+ constructor(expr) {
122
+ this.expr = expr;
123
+ this.kind = "include";
124
+ }
125
+ };
126
+ var Exclude = class {
127
+ kind;
128
+ expr;
129
+ constructor(expr) {
130
+ this.expr = expr;
131
+ this.kind = "exclude";
132
+ }
133
+ };
134
+ function and(...args) {
135
+ return new And(...args);
136
+ }
137
+ function or(...args) {
138
+ return new Or(...args);
139
+ }
140
+ function not(expr) {
141
+ return new Not(expr);
142
+ }
143
+ function id(pattern) {
144
+ return new Id(pattern);
145
+ }
146
+ function moduleType(pattern) {
147
+ return new ModuleType(pattern);
148
+ }
149
+ function code(pattern) {
150
+ return new Code(pattern);
151
+ }
152
+ function include(expr) {
153
+ return new Include(expr);
154
+ }
155
+ function exclude(expr) {
156
+ return new Exclude(expr);
157
+ }
158
+
159
+ //#endregion
160
+ Object.defineProperty(exports, 'And', {
161
+ enumerable: true,
162
+ get: function () {
163
+ return And;
164
+ }
165
+ });
166
+ Object.defineProperty(exports, 'and', {
167
+ enumerable: true,
168
+ get: function () {
169
+ return and;
170
+ }
171
+ });
172
+ Object.defineProperty(exports, 'arraify', {
173
+ enumerable: true,
174
+ get: function () {
175
+ return arraify;
176
+ }
177
+ });
178
+ Object.defineProperty(exports, 'code', {
179
+ enumerable: true,
180
+ get: function () {
181
+ return code;
182
+ }
183
+ });
184
+ Object.defineProperty(exports, 'exclude', {
185
+ enumerable: true,
186
+ get: function () {
187
+ return exclude;
188
+ }
189
+ });
190
+ Object.defineProperty(exports, 'id', {
191
+ enumerable: true,
192
+ get: function () {
193
+ return id;
194
+ }
195
+ });
196
+ Object.defineProperty(exports, 'include', {
197
+ enumerable: true,
198
+ get: function () {
199
+ return include;
200
+ }
201
+ });
202
+ Object.defineProperty(exports, 'isNullish', {
203
+ enumerable: true,
204
+ get: function () {
205
+ return isNullish;
206
+ }
207
+ });
208
+ Object.defineProperty(exports, 'moduleType', {
209
+ enumerable: true,
210
+ get: function () {
211
+ return moduleType;
212
+ }
213
+ });
214
+ Object.defineProperty(exports, 'noop', {
215
+ enumerable: true,
216
+ get: function () {
217
+ return noop;
218
+ }
219
+ });
220
+ Object.defineProperty(exports, 'not', {
221
+ enumerable: true,
222
+ get: function () {
223
+ return not;
224
+ }
225
+ });
226
+ Object.defineProperty(exports, 'or', {
227
+ enumerable: true,
228
+ get: function () {
229
+ return or;
230
+ }
231
+ });
232
+ Object.defineProperty(exports, 'unimplemented', {
233
+ enumerable: true,
234
+ get: function () {
235
+ return unimplemented;
236
+ }
237
+ });
238
+ Object.defineProperty(exports, 'unreachable', {
239
+ enumerable: true,
240
+ get: function () {
241
+ return unreachable;
242
+ }
243
+ });
244
+ Object.defineProperty(exports, 'unsupported', {
245
+ enumerable: true,
246
+ get: function () {
247
+ return unsupported;
248
+ }
249
+ });
250
+ Object.defineProperty(exports, 'withFilter', {
251
+ enumerable: true,
252
+ get: function () {
253
+ return withFilter;
254
+ }
255
+ });