rolldown 1.0.0-beta.8-commit.852c603 → 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.
package/dist/cli.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
2
- const require_src = require('./shared/src-B4f_CmD8.cjs');
2
+ const require_src = require('./shared/src-kB4wOq3x.cjs');
3
3
  require('./shared/parse-ast-index-Bbz37LOL.cjs');
4
- require('./shared/filter-expression-index-CRtoeipP.cjs');
4
+ const require_filter_index = require('./shared/filter-index-DblXSw9s.cjs');
5
5
  const node_fs = require_chunk.__toESM(require("node:fs"));
6
6
  const node_path = require_chunk.__toESM(require("node:path"));
7
7
  const ansis = require_chunk.__toESM(require("ansis"));
@@ -1664,11 +1664,11 @@ async function bundleWithCliOptions(cliOptions) {
1664
1664
  }
1665
1665
  }
1666
1666
  async function watchInner(config, cliOptions) {
1667
- let normalizedConfig = require_src.arraify(config).map((option) => {
1667
+ let normalizedConfig = require_filter_index.arraify(config).map((option) => {
1668
1668
  return {
1669
1669
  ...option,
1670
1670
  ...cliOptions.input,
1671
- output: require_src.arraify(option.output || {}).map((output) => {
1671
+ output: require_filter_index.arraify(option.output || {}).map((output) => {
1672
1672
  return {
1673
1673
  ...output,
1674
1674
  ...cliOptions.output
@@ -1707,9 +1707,9 @@ async function watchInner(config, cliOptions) {
1707
1707
  async function bundleInner(config, cliOptions) {
1708
1708
  const startTime = node_perf_hooks.performance.now();
1709
1709
  const result = [];
1710
- const configList = require_src.arraify(config);
1710
+ const configList = require_filter_index.arraify(config);
1711
1711
  for (const config$1 of configList) {
1712
- const outputList = require_src.arraify(config$1.output || {});
1712
+ const outputList = require_filter_index.arraify(config$1.output || {});
1713
1713
  const build = await require_src.rolldown({
1714
1714
  ...config$1,
1715
1715
  ...cliOptions.input
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { __commonJS, __esm, __toESM } from "./shared/chunk-DUYDk_2O.mjs";
2
- import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_misc, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-CaxK4-gB.mjs";
2
+ import { description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-gyFaNJxP.mjs";
3
3
  import "./shared/parse-ast-index-D0SmlXT6.mjs";
4
- import "./shared/filter-expression-index-BKmgnKlV.mjs";
4
+ import { arraify, init_misc } from "./shared/filter-index-hnEzlqRW.mjs";
5
5
  import fs from "node:fs";
6
6
  import path, { sep } from "node:path";
7
7
  import colors from "ansis";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('./shared/src-B4f_CmD8.cjs');
3
+ const require_src = require('./shared/src-kB4wOq3x.cjs');
4
4
  const require_parse_ast_index = require('./shared/parse-ast-index-Bbz37LOL.cjs');
5
- require('./shared/filter-expression-index-CRtoeipP.cjs');
5
+ require('./shared/filter-index-DblXSw9s.cjs');
6
6
  const node_url = require_chunk.__toESM(require("node:url"));
7
7
 
8
8
  //#region src/api/experimental.ts
@@ -1,5 +1,5 @@
1
1
  import { BindingReplacePluginConfig, BindingTransformPluginConfig, TransformOptions, TransformResult$1 as TransformResult, moduleRunnerTransform, transform } from "./shared/binding.d-y7dWnUxd.cjs";
2
- import { BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/input-options.d-BHwth6VM.cjs";
2
+ import { BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/input-options.d-C7BRiiq8.cjs";
3
3
 
4
4
  //#region src/api/experimental.d.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { BindingReplacePluginConfig, BindingTransformPluginConfig, TransformOptions, TransformResult$1 as TransformResult, moduleRunnerTransform, transform } from "./shared/binding.d-BaNmLM9c.mjs";
2
- 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-CN-JV5dt.mjs";
2
+ 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-CN3-qk1U.mjs";
3
3
 
4
4
  //#region src/api/experimental.d.ts
5
5
  /**
@@ -1,6 +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-CaxK4-gB.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-gyFaNJxP.mjs";
2
2
  import { import_binding } from "./shared/parse-ast-index-D0SmlXT6.mjs";
3
- import "./shared/filter-expression-index-BKmgnKlV.mjs";
3
+ import "./shared/filter-index-hnEzlqRW.mjs";
4
4
  import { pathToFileURL } from "node:url";
5
5
 
6
6
  //#region src/api/experimental.ts
@@ -0,0 +1,12 @@
1
+ const require_filter_index = require('./shared/filter-index-DblXSw9s.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
@@ -1,4 +1,4 @@
1
1
  import "./shared/binding.d-y7dWnUxd.cjs";
2
- import { And, FilterExpression, FilterExpressionKind, TopLevelFilterExpression, and, code, exclude, id, include, moduleType, not, or } from "./shared/input-options.d-BHwth6VM.cjs";
2
+ import { And, FilterExpression, FilterExpressionKind, TopLevelFilterExpression, and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/input-options.d-C7BRiiq8.cjs";
3
3
 
4
- export { And, FilterExpression, FilterExpressionKind, TopLevelFilterExpression, and, code, exclude, id, include, moduleType, not, or };
4
+ export { And, FilterExpression, FilterExpressionKind, TopLevelFilterExpression, and, code, exclude, id, include, moduleType, not, or, withFilter };
@@ -1,4 +1,4 @@
1
1
  import "./shared/binding.d-BaNmLM9c.mjs";
2
- 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 } from "./shared/input-options.d-CN-JV5dt.mjs";
2
+ 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-CN3-qk1U.mjs";
3
3
 
4
- export { And, FilterExpression, FilterExpressionKind, TopLevelFilterExpression, and, code, exclude, id, include, moduleType, not, or };
4
+ 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-hnEzlqRW.mjs";
2
+
3
+ init_filter_index();
4
+ export { And, and, code, exclude, id, include, moduleType, not, or, withFilter };
package/dist/index.cjs CHANGED
@@ -1,10 +1,9 @@
1
- const require_src = require('./shared/src-B4f_CmD8.cjs');
1
+ const require_src = require('./shared/src-kB4wOq3x.cjs');
2
2
  require('./shared/parse-ast-index-Bbz37LOL.cjs');
3
- require('./shared/filter-expression-index-CRtoeipP.cjs');
3
+ require('./shared/filter-index-DblXSw9s.cjs');
4
4
 
5
5
  exports.VERSION = require_src.VERSION
6
6
  exports.build = require_src.build
7
7
  exports.defineConfig = require_src.defineConfig
8
8
  exports.rolldown = require_src.rolldown
9
- exports.watch = require_src.watch
10
- exports.withFilter = require_src.withFilter
9
+ exports.watch = require_src.watch
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { PreRenderedChunk } from "./shared/binding.d-y7dWnUxd.cjs";
2
- 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, 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, withFilter } from "./shared/input-options.d-BHwth6VM.cjs";
2
+ 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, 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-C7BRiiq8.cjs";
3
3
 
4
- 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, withFilter };
4
+ 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,4 +1,4 @@
1
1
  import { PreRenderedChunk } from "./shared/binding.d-BaNmLM9c.mjs";
2
- 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, 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, withFilter$1 as withFilter } from "./shared/input-options.d-CN-JV5dt.mjs";
2
+ 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, 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-CN3-qk1U.mjs";
3
3
 
4
- 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, withFilter };
4
+ 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,6 +1,6 @@
1
- import { VERSION, build, defineConfig, init_src, rolldown, watch, withFilter } from "./shared/src-CaxK4-gB.mjs";
1
+ import { VERSION, build, defineConfig, init_src, rolldown, watch } from "./shared/src-gyFaNJxP.mjs";
2
2
  import "./shared/parse-ast-index-D0SmlXT6.mjs";
3
- import "./shared/filter-expression-index-BKmgnKlV.mjs";
3
+ import "./shared/filter-index-hnEzlqRW.mjs";
4
4
 
5
5
  init_src();
6
- export { VERSION, build, defineConfig, rolldown, watch, withFilter };
6
+ export { VERSION, build, defineConfig, rolldown, watch };
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
2
- const require_src = require('./shared/src-B4f_CmD8.cjs');
2
+ const require_src = require('./shared/src-kB4wOq3x.cjs');
3
3
  const require_parse_ast_index = require('./shared/parse-ast-index-Bbz37LOL.cjs');
4
- require('./shared/filter-expression-index-CRtoeipP.cjs');
4
+ require('./shared/filter-index-DblXSw9s.cjs');
5
5
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
6
6
 
7
7
  //#region src/parallel-plugin-worker.ts
@@ -1,7 +1,7 @@
1
1
  import { __commonJS } from "./shared/chunk-DUYDk_2O.mjs";
2
- import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-CaxK4-gB.mjs";
2
+ import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-gyFaNJxP.mjs";
3
3
  import { import_binding } from "./shared/parse-ast-index-D0SmlXT6.mjs";
4
- import "./shared/filter-expression-index-BKmgnKlV.mjs";
4
+ import "./shared/filter-index-hnEzlqRW.mjs";
5
5
  import { parentPort, workerData } from "node:worker_threads";
6
6
 
7
7
  //#region src/parallel-plugin-worker.ts
@@ -1,5 +1,5 @@
1
1
  import "./shared/binding.d-y7dWnUxd.cjs";
2
- import { MaybePromise, Plugin } from "./shared/input-options.d-BHwth6VM.cjs";
2
+ import { MaybePromise, Plugin } from "./shared/input-options.d-C7BRiiq8.cjs";
3
3
 
4
4
  //#region src/plugin/parallel-plugin-implementation.d.ts
5
5
  type ParallelPluginImplementation = Plugin;
@@ -1,5 +1,5 @@
1
1
  import "./shared/binding.d-BaNmLM9c.mjs";
2
- import { MaybePromise, Plugin } from "./shared/input-options.d-CN-JV5dt.mjs";
2
+ import { MaybePromise, Plugin } from "./shared/input-options.d-CN3-qk1U.mjs";
3
3
 
4
4
  //#region src/plugin/parallel-plugin-implementation.d.ts
5
5
  type ParallelPluginImplementation = Plugin;
@@ -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
+ });
@@ -0,0 +1,174 @@
1
+ import { __esm } from "./chunk-DUYDk_2O.mjs";
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
+ var init_misc = __esm({ "src/utils/misc.ts"() {} });
26
+
27
+ //#endregion
28
+ //#region src/plugin/with-filter.ts
29
+ function withFilterImpl(pluginOption, filterObjectList) {
30
+ if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
31
+ if (pluginOption == false || pluginOption == null) return pluginOption;
32
+ if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
33
+ let plugin = pluginOption;
34
+ let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
35
+ if (filterObjectIndex === -1) return plugin;
36
+ let filterObject = filterObjectList[filterObjectIndex];
37
+ Object.keys(plugin).forEach((key) => {
38
+ switch (key) {
39
+ case "transform":
40
+ case "resolveId":
41
+ case "load":
42
+ if (!plugin[key]) return;
43
+ if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
44
+ else plugin[key] = {
45
+ handler: plugin[key],
46
+ filter: filterObject[key]
47
+ };
48
+ break;
49
+ default: break;
50
+ }
51
+ });
52
+ return plugin;
53
+ }
54
+ function withFilter(pluginOption, filterObject) {
55
+ return withFilterImpl(pluginOption, arraify(filterObject));
56
+ }
57
+ function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
58
+ if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
59
+ for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
60
+ let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
61
+ if (typeof pattern === "string" && pattern === pluginName) return i;
62
+ else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
63
+ }
64
+ return -1;
65
+ }
66
+ var init_with_filter = __esm({ "src/plugin/with-filter.ts"() {
67
+ init_misc();
68
+ } });
69
+
70
+ //#endregion
71
+ //#region src/plugin/index.ts
72
+ var init_plugin = __esm({ "src/plugin/index.ts"() {
73
+ init_with_filter();
74
+ } });
75
+
76
+ //#endregion
77
+ //#region src/filter-index.ts
78
+ function and(...args) {
79
+ return new And(...args);
80
+ }
81
+ function or(...args) {
82
+ return new Or(...args);
83
+ }
84
+ function not(expr) {
85
+ return new Not(expr);
86
+ }
87
+ function id(pattern) {
88
+ return new Id(pattern);
89
+ }
90
+ function moduleType(pattern) {
91
+ return new ModuleType(pattern);
92
+ }
93
+ function code(pattern) {
94
+ return new Code(pattern);
95
+ }
96
+ function include(expr) {
97
+ return new Include(expr);
98
+ }
99
+ function exclude(expr) {
100
+ return new Exclude(expr);
101
+ }
102
+ var And, Or, Not, Id, ModuleType, Code, Include, Exclude;
103
+ var init_filter_index = __esm({ "src/filter-index.ts"() {
104
+ init_plugin();
105
+ And = class {
106
+ kind;
107
+ args;
108
+ constructor(...args) {
109
+ if (args.length === 0) throw new Error("`And` expects at least one operand");
110
+ this.args = args;
111
+ this.kind = "and";
112
+ }
113
+ };
114
+ Or = class {
115
+ kind;
116
+ args;
117
+ constructor(...args) {
118
+ if (args.length === 0) throw new Error("`Or` expects at least one operand");
119
+ this.args = args;
120
+ this.kind = "or";
121
+ }
122
+ };
123
+ Not = class {
124
+ kind;
125
+ expr;
126
+ constructor(expr) {
127
+ this.expr = expr;
128
+ this.kind = "not";
129
+ }
130
+ };
131
+ Id = class {
132
+ kind;
133
+ pattern;
134
+ constructor(pattern) {
135
+ this.pattern = pattern;
136
+ this.kind = "id";
137
+ }
138
+ };
139
+ ModuleType = class {
140
+ kind;
141
+ pattern;
142
+ constructor(pattern) {
143
+ this.pattern = pattern;
144
+ this.kind = "moduleType";
145
+ }
146
+ };
147
+ Code = class {
148
+ kind;
149
+ pattern;
150
+ constructor(expr) {
151
+ this.pattern = expr;
152
+ this.kind = "code";
153
+ }
154
+ };
155
+ Include = class {
156
+ kind;
157
+ expr;
158
+ constructor(expr) {
159
+ this.expr = expr;
160
+ this.kind = "include";
161
+ }
162
+ };
163
+ Exclude = class {
164
+ kind;
165
+ expr;
166
+ constructor(expr) {
167
+ this.expr = expr;
168
+ this.kind = "exclude";
169
+ }
170
+ };
171
+ } });
172
+
173
+ //#endregion
174
+ export { And, and, arraify, code, exclude, id, include, init_filter_index, init_misc, isNullish, moduleType, noop, not, or, unimplemented, unreachable, unsupported, withFilter };