@rolldown/browser 1.0.0-beta.23 → 1.0.0-beta.25
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 +7 -7
- package/dist/cli.mjs +7 -7
- package/dist/config.cjs +3 -3
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.browser.mjs +1 -1
- package/dist/experimental-index.cjs +2 -2
- package/dist/experimental-index.d.cts +2 -4
- package/dist/experimental-index.d.mts +2 -4
- package/dist/experimental-index.mjs +2 -2
- package/dist/experimental-runtime-types.d.ts +3 -2
- package/dist/filter-index.d.cts +2 -2
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.browser.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.cjs +2 -2
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.cts +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.cts +1 -2
- package/dist/parse-ast-index.d.mts +1 -2
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasi-browser.js +1 -4
- package/dist/rolldown-binding.wasi.cjs +24 -4
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-CMKStSph.d.cts → binding-B9-3a5q4.d.cts} +0 -10
- package/dist/shared/{binding-DB58iXP8.d.mts → binding-DQYRWAqj.d.mts} +0 -10
- package/dist/shared/{define-config-BRkYSF9E.d.cts → define-config-BtEiHmBk.d.mts} +36 -31
- package/dist/shared/{define-config-CqVfqfZQ.d.mts → define-config-ZN70csxk.d.cts} +36 -31
- package/dist/shared/{load-config-BWbXOTbl.mjs → load-config-B_r5s5Sw.mjs} +1 -1
- package/dist/shared/{load-config-Bh2dNRk9.cjs → load-config-CbbGAxoK.cjs} +1 -1
- package/dist/shared/{parse-ast-index-CGTVCgvx.cjs → parse-ast-index-80TSV2Ni.cjs} +14 -2
- package/dist/shared/{parse-ast-index-BzdtcWzA.mjs → parse-ast-index-Bo5jcF9A.mjs} +9 -3
- package/dist/shared/{src-BA5CL--T.mjs → src-DgEwyn6q.mjs} +107 -64
- package/dist/shared/{src-Co_Bf7DL.cjs → src-Dtgcnc61.cjs} +106 -63
- package/dist/{src-C1KTaRyZ.js → src-nDvl0w95.js} +114 -65
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-
|
|
1
|
+
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-DQYRWAqj.mjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
|
|
@@ -426,6 +426,14 @@ interface OutputOptions {
|
|
|
426
426
|
preserveModules?: boolean;
|
|
427
427
|
virtualDirname?: string;
|
|
428
428
|
preserveModulesRoot?: string;
|
|
429
|
+
topLevelVar?: boolean;
|
|
430
|
+
/**
|
|
431
|
+
* - Type: `boolean`
|
|
432
|
+
* - Default: `false`
|
|
433
|
+
*
|
|
434
|
+
* Whether to minify internal exports.
|
|
435
|
+
*/
|
|
436
|
+
minifyInternalExports?: boolean;
|
|
429
437
|
}
|
|
430
438
|
//#endregion
|
|
431
439
|
//#region src/api/build.d.ts
|
|
@@ -453,16 +461,12 @@ declare class RolldownBuild {
|
|
|
453
461
|
write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
|
|
454
462
|
close(): Promise<void>;
|
|
455
463
|
[Symbol.asyncDispose](): Promise<void>;
|
|
456
|
-
generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch>;
|
|
464
|
+
generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch | undefined>;
|
|
457
465
|
hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutputPatch>;
|
|
458
|
-
// TODO(underfin)
|
|
459
|
-
// The `watchFiles` method returns a promise, but Rollup does not.
|
|
460
|
-
// Converting it to a synchronous API might cause a deadlock if the user calls `write` and `watchFiles` simultaneously.
|
|
461
466
|
get watchFiles(): Promise<string[]>;
|
|
462
467
|
}
|
|
463
468
|
//#endregion
|
|
464
469
|
//#region src/api/rolldown/index.d.ts
|
|
465
|
-
// `async` here is intentional to be compatible with `rollup.rollup`.
|
|
466
470
|
declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
|
|
467
471
|
//#endregion
|
|
468
472
|
//#region src/options/watch-options.d.ts
|
|
@@ -473,7 +477,6 @@ interface WatchOptions extends InputOptions {
|
|
|
473
477
|
//#region src/api/watch/watch-emitter.d.ts
|
|
474
478
|
type WatcherEvent = "close" | "event" | "restart" | "change";
|
|
475
479
|
type ChangeEvent$1 = "create" | "update" | "delete";
|
|
476
|
-
// TODO: find a way use `RolldownBuild` instead of `Bundler`.
|
|
477
480
|
type RolldownWatchBuild = BindingBundlerImpl;
|
|
478
481
|
type RolldownWatcherEvent = {
|
|
479
482
|
code: "START";
|
|
@@ -482,7 +485,6 @@ type RolldownWatcherEvent = {
|
|
|
482
485
|
} | {
|
|
483
486
|
code: "BUNDLE_END";
|
|
484
487
|
duration: number;
|
|
485
|
-
// input?: InputOption
|
|
486
488
|
output: readonly string[];
|
|
487
489
|
result: RolldownWatchBuild;
|
|
488
490
|
} | {
|
|
@@ -508,7 +510,6 @@ declare class WatcherEmitter {
|
|
|
508
510
|
type RolldownWatcher = WatcherEmitter;
|
|
509
511
|
//#endregion
|
|
510
512
|
//#region src/api/watch/index.d.ts
|
|
511
|
-
// Compat to `rollup.watch`
|
|
512
513
|
declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher;
|
|
513
514
|
//#endregion
|
|
514
515
|
//#region src/log/log-handler.d.ts
|
|
@@ -526,7 +527,6 @@ interface NormalizedInputOptions {
|
|
|
526
527
|
platform: InputOptions["platform"];
|
|
527
528
|
shimMissingExports: boolean;
|
|
528
529
|
}
|
|
529
|
-
// TODO: I guess we make these getters enumerable so it act more like a plain object
|
|
530
530
|
//#endregion
|
|
531
531
|
//#region src/options/normalized-output-options.d.ts
|
|
532
532
|
type InternalModuleFormat = "es" | "cjs" | "iife" | "umd";
|
|
@@ -562,8 +562,9 @@ interface NormalizedOutputOptions {
|
|
|
562
562
|
preserveModules: boolean;
|
|
563
563
|
virtualDirname: string;
|
|
564
564
|
preserveModulesRoot?: string;
|
|
565
|
+
topLevelVar?: boolean;
|
|
566
|
+
minifyInternalExports?: boolean;
|
|
565
567
|
}
|
|
566
|
-
// TODO: I guess we make these getters enumerable so it act more like a plain object
|
|
567
568
|
//#endregion
|
|
568
569
|
//#region src/plugin/hook-filter.d.ts
|
|
569
570
|
type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
|
|
@@ -657,6 +658,7 @@ interface EmittedChunk {
|
|
|
657
658
|
}
|
|
658
659
|
type EmittedFile = EmittedAsset | EmittedChunk;
|
|
659
660
|
interface PluginContextResolveOptions {
|
|
661
|
+
isEntry?: boolean;
|
|
660
662
|
skipSelf?: boolean;
|
|
661
663
|
custom?: CustomPluginOptions;
|
|
662
664
|
}
|
|
@@ -726,12 +728,15 @@ declare const VERSION: string;
|
|
|
726
728
|
//#region src/builtin-plugin/constructors.d.ts
|
|
727
729
|
declare class BuiltinPlugin {
|
|
728
730
|
name: BindingBuiltinPluginName;
|
|
729
|
-
// NOTE: has `_` to avoid conflict with `options` hook
|
|
730
731
|
_options?: unknown;
|
|
731
732
|
constructor(name: BindingBuiltinPluginName, _options?: unknown);
|
|
732
733
|
}
|
|
733
734
|
declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
734
|
-
|
|
735
|
+
type DynamicImportVarsPluginConfig = Omit<BindingDynamicImportVarsPluginConfig, "include" | "exclude"> & {
|
|
736
|
+
include?: StringOrRegExp | StringOrRegExp[];
|
|
737
|
+
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
738
|
+
};
|
|
739
|
+
declare function dynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
|
|
735
740
|
declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
|
|
736
741
|
declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
|
|
737
742
|
declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
|
|
@@ -788,7 +793,6 @@ declare function withFilter<A, T extends RolldownPluginOption<A>>(pluginOption:
|
|
|
788
793
|
//#endregion
|
|
789
794
|
//#region src/plugin/index.d.ts
|
|
790
795
|
type ModuleSideEffects = boolean | "no-treeshake" | null;
|
|
791
|
-
// ref: https://github.com/microsoft/TypeScript/issues/33471#issuecomment-1376364329
|
|
792
796
|
type ModuleType = "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | (string & {});
|
|
793
797
|
type ImportKind = BindingHookResolveIdExtraArgs["kind"];
|
|
794
798
|
interface CustomPluginOptions {
|
|
@@ -797,8 +801,6 @@ interface CustomPluginOptions {
|
|
|
797
801
|
interface ModuleOptions {
|
|
798
802
|
moduleSideEffects: ModuleSideEffects;
|
|
799
803
|
meta: CustomPluginOptions;
|
|
800
|
-
// flag used to check if user directly modified the `ModuleInfo`
|
|
801
|
-
// this is used to sync state between rust and js
|
|
802
804
|
invalidate?: boolean;
|
|
803
805
|
}
|
|
804
806
|
interface ResolvedId extends ModuleOptions {
|
|
@@ -828,9 +830,7 @@ type RenderedChunkMeta = {
|
|
|
828
830
|
interface FunctionPluginHooks {
|
|
829
831
|
[DEFINED_HOOK_NAMES.onLog]: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => NullValue | boolean;
|
|
830
832
|
[DEFINED_HOOK_NAMES.options]: (this: MinimalPluginContext, options: InputOptions) => NullValue | InputOptions;
|
|
831
|
-
// TODO find a way to make `this: PluginContext` work.
|
|
832
833
|
[DEFINED_HOOK_NAMES.outputOptions]: (this: MinimalPluginContext, options: OutputOptions) => NullValue | OutputOptions;
|
|
833
|
-
// --- Build hooks ---
|
|
834
834
|
[DEFINED_HOOK_NAMES.buildStart]: (this: PluginContext, options: NormalizedInputOptions) => void;
|
|
835
835
|
[DEFINED_HOOK_NAMES.resolveId]: (this: PluginContext, source: string, importer: string | undefined, extraOptions: ResolveIdExtraOptions) => ResolveIdResult;
|
|
836
836
|
/**
|
|
@@ -844,7 +844,6 @@ interface FunctionPluginHooks {
|
|
|
844
844
|
}) => TransformResult;
|
|
845
845
|
[DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
|
|
846
846
|
[DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
|
|
847
|
-
// --- Generate hooks ---
|
|
848
847
|
[DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
|
|
849
848
|
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | {
|
|
850
849
|
code: string;
|
|
@@ -855,7 +854,6 @@ interface FunctionPluginHooks {
|
|
|
855
854
|
[DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
|
|
856
855
|
[DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
|
|
857
856
|
[DEFINED_HOOK_NAMES.closeBundle]: (this: PluginContext) => void;
|
|
858
|
-
// --- watch hooks ---
|
|
859
857
|
[DEFINED_HOOK_NAMES.watchChange]: (this: PluginContext, id: string, event: {
|
|
860
858
|
event: ChangeEvent;
|
|
861
859
|
}) => void;
|
|
@@ -870,13 +868,8 @@ type ObjectHook<T, O = {}> = T | ({
|
|
|
870
868
|
handler: T;
|
|
871
869
|
} & ObjectHookMeta & O);
|
|
872
870
|
type SyncPluginHooks = DefinedHookNames["augmentChunkHash" | "onLog" | "outputOptions"];
|
|
873
|
-
// | 'renderDynamicImport'
|
|
874
|
-
// | 'resolveFileUrl'
|
|
875
|
-
// | 'resolveImportMeta'
|
|
876
871
|
type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
|
|
877
872
|
type FirstPluginHooks = DefinedHookNames["load" | "resolveDynamicImport" | "resolveId"];
|
|
878
|
-
// | 'resolveImportMeta'
|
|
879
|
-
// | 'shouldTransformCachedModule'
|
|
880
873
|
type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform"];
|
|
881
874
|
type AddonHooks = DefinedHookNames["banner" | "footer" | "intro" | "outro"];
|
|
882
875
|
type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
|
|
@@ -903,11 +896,9 @@ type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook<K extends Asyn
|
|
|
903
896
|
type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
|
|
904
897
|
type AddonHook = string | AddonHookFunction;
|
|
905
898
|
interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
|
|
906
|
-
// cacheKey?: string
|
|
907
899
|
name: string;
|
|
908
900
|
}
|
|
909
901
|
interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
|
|
910
|
-
// for inter-plugin communication
|
|
911
902
|
api?: A;
|
|
912
903
|
}
|
|
913
904
|
type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin;
|
|
@@ -920,8 +911,6 @@ type RolldownOutputPluginOption = MaybePromise<NullValue<RolldownOutputPlugin> |
|
|
|
920
911
|
} | false | RolldownOutputPluginOption[]>;
|
|
921
912
|
//#endregion
|
|
922
913
|
//#region src/options/generated/checks-options.d.ts
|
|
923
|
-
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
|
924
|
-
// To edit this generated file you have to edit `tasks/generator/src/generators/checks.rs`
|
|
925
914
|
interface ChecksOptions {
|
|
926
915
|
/**
|
|
927
916
|
* Whether to emit warning when detecting circular dependency
|
|
@@ -982,7 +971,6 @@ interface ChecksOptions {
|
|
|
982
971
|
//#endregion
|
|
983
972
|
//#region src/options/input-options.d.ts
|
|
984
973
|
type InputOption = string | string[] | Record<string, string>;
|
|
985
|
-
// Omit those key that are part of rolldown option
|
|
986
974
|
type OxcTransformOption = Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject">;
|
|
987
975
|
type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
|
|
988
976
|
type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset">;
|
|
@@ -1002,7 +990,11 @@ type HmrOptions = boolean | {
|
|
|
1002
990
|
port?: number;
|
|
1003
991
|
implement?: string;
|
|
1004
992
|
};
|
|
993
|
+
type OptimizationOptions = {
|
|
994
|
+
inlineConst?: boolean;
|
|
995
|
+
};
|
|
1005
996
|
type AttachDebugOptions = "none" | "simple" | "full";
|
|
997
|
+
type ChunkModulesOrder = "exec-order" | "module-id";
|
|
1006
998
|
interface RollupJsxOptions {
|
|
1007
999
|
mode?: "classic" | "automatic" | "preserve";
|
|
1008
1000
|
factory?: string;
|
|
@@ -1061,6 +1053,18 @@ interface InputOptions {
|
|
|
1061
1053
|
resolveNewUrlToAsset?: boolean;
|
|
1062
1054
|
hmr?: HmrOptions;
|
|
1063
1055
|
/**
|
|
1056
|
+
* Control which order should use when rendering modules in chunk
|
|
1057
|
+
*
|
|
1058
|
+
* - Type: `'exec-order' | 'module-id'
|
|
1059
|
+
* - Default: `'exec-order'`
|
|
1060
|
+
*
|
|
1061
|
+
* - `exec-order`: Almost equivalent to the topological order of the module graph, but specially handling when module graph has cycle.
|
|
1062
|
+
* - `module-id`: This is more friendly for gzip compression, especially for some javascript static asset lib (e.g. icon library)
|
|
1063
|
+
* > [!NOTE]
|
|
1064
|
+
* > Try to sort the modules by their module id if possible(Since rolldown scope hoist all modules in the chunk, we only try to sort those modules by module id if we could ensure runtime behavior is correct after sorting).
|
|
1065
|
+
*/
|
|
1066
|
+
chunkModulesOrder?: ChunkModulesOrder;
|
|
1067
|
+
/**
|
|
1064
1068
|
* Attach debug information to the output bundle.
|
|
1065
1069
|
*
|
|
1066
1070
|
* - Type: `'none' | 'simple' | 'full'`
|
|
@@ -1183,6 +1187,7 @@ interface InputOptions {
|
|
|
1183
1187
|
sessionId?: string;
|
|
1184
1188
|
};
|
|
1185
1189
|
preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
|
|
1190
|
+
optimization?: OptimizationOptions;
|
|
1186
1191
|
}
|
|
1187
1192
|
//#endregion
|
|
1188
1193
|
//#region src/types/rolldown-options.d.ts
|
|
@@ -1201,4 +1206,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
|
1201
1206
|
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
1202
1207
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
1203
1208
|
//#endregion
|
|
1204
|
-
export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, 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, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
|
|
1209
|
+
export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-
|
|
1
|
+
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-B9-3a5q4.cjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
|
|
@@ -426,6 +426,14 @@ interface OutputOptions {
|
|
|
426
426
|
preserveModules?: boolean;
|
|
427
427
|
virtualDirname?: string;
|
|
428
428
|
preserveModulesRoot?: string;
|
|
429
|
+
topLevelVar?: boolean;
|
|
430
|
+
/**
|
|
431
|
+
* - Type: `boolean`
|
|
432
|
+
* - Default: `false`
|
|
433
|
+
*
|
|
434
|
+
* Whether to minify internal exports.
|
|
435
|
+
*/
|
|
436
|
+
minifyInternalExports?: boolean;
|
|
429
437
|
}
|
|
430
438
|
//#endregion
|
|
431
439
|
//#region src/api/build.d.ts
|
|
@@ -453,16 +461,12 @@ declare class RolldownBuild {
|
|
|
453
461
|
write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
|
|
454
462
|
close(): Promise<void>;
|
|
455
463
|
[Symbol.asyncDispose](): Promise<void>;
|
|
456
|
-
generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch>;
|
|
464
|
+
generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch | undefined>;
|
|
457
465
|
hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutputPatch>;
|
|
458
|
-
// TODO(underfin)
|
|
459
|
-
// The `watchFiles` method returns a promise, but Rollup does not.
|
|
460
|
-
// Converting it to a synchronous API might cause a deadlock if the user calls `write` and `watchFiles` simultaneously.
|
|
461
466
|
get watchFiles(): Promise<string[]>;
|
|
462
467
|
}
|
|
463
468
|
//#endregion
|
|
464
469
|
//#region src/api/rolldown/index.d.ts
|
|
465
|
-
// `async` here is intentional to be compatible with `rollup.rollup`.
|
|
466
470
|
declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
|
|
467
471
|
//#endregion
|
|
468
472
|
//#region src/options/watch-options.d.ts
|
|
@@ -473,7 +477,6 @@ interface WatchOptions extends InputOptions {
|
|
|
473
477
|
//#region src/api/watch/watch-emitter.d.ts
|
|
474
478
|
type WatcherEvent = "close" | "event" | "restart" | "change";
|
|
475
479
|
type ChangeEvent$1 = "create" | "update" | "delete";
|
|
476
|
-
// TODO: find a way use `RolldownBuild` instead of `Bundler`.
|
|
477
480
|
type RolldownWatchBuild = BindingBundlerImpl;
|
|
478
481
|
type RolldownWatcherEvent = {
|
|
479
482
|
code: "START";
|
|
@@ -482,7 +485,6 @@ type RolldownWatcherEvent = {
|
|
|
482
485
|
} | {
|
|
483
486
|
code: "BUNDLE_END";
|
|
484
487
|
duration: number;
|
|
485
|
-
// input?: InputOption
|
|
486
488
|
output: readonly string[];
|
|
487
489
|
result: RolldownWatchBuild;
|
|
488
490
|
} | {
|
|
@@ -508,7 +510,6 @@ declare class WatcherEmitter {
|
|
|
508
510
|
type RolldownWatcher = WatcherEmitter;
|
|
509
511
|
//#endregion
|
|
510
512
|
//#region src/api/watch/index.d.ts
|
|
511
|
-
// Compat to `rollup.watch`
|
|
512
513
|
declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher;
|
|
513
514
|
//#endregion
|
|
514
515
|
//#region src/log/log-handler.d.ts
|
|
@@ -526,7 +527,6 @@ interface NormalizedInputOptions {
|
|
|
526
527
|
platform: InputOptions["platform"];
|
|
527
528
|
shimMissingExports: boolean;
|
|
528
529
|
}
|
|
529
|
-
// TODO: I guess we make these getters enumerable so it act more like a plain object
|
|
530
530
|
//#endregion
|
|
531
531
|
//#region src/options/normalized-output-options.d.ts
|
|
532
532
|
type InternalModuleFormat = "es" | "cjs" | "iife" | "umd";
|
|
@@ -562,8 +562,9 @@ interface NormalizedOutputOptions {
|
|
|
562
562
|
preserveModules: boolean;
|
|
563
563
|
virtualDirname: string;
|
|
564
564
|
preserveModulesRoot?: string;
|
|
565
|
+
topLevelVar?: boolean;
|
|
566
|
+
minifyInternalExports?: boolean;
|
|
565
567
|
}
|
|
566
|
-
// TODO: I guess we make these getters enumerable so it act more like a plain object
|
|
567
568
|
//#endregion
|
|
568
569
|
//#region src/plugin/hook-filter.d.ts
|
|
569
570
|
type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
|
|
@@ -657,6 +658,7 @@ interface EmittedChunk {
|
|
|
657
658
|
}
|
|
658
659
|
type EmittedFile = EmittedAsset | EmittedChunk;
|
|
659
660
|
interface PluginContextResolveOptions {
|
|
661
|
+
isEntry?: boolean;
|
|
660
662
|
skipSelf?: boolean;
|
|
661
663
|
custom?: CustomPluginOptions;
|
|
662
664
|
}
|
|
@@ -726,12 +728,15 @@ declare const VERSION: string;
|
|
|
726
728
|
//#region src/builtin-plugin/constructors.d.ts
|
|
727
729
|
declare class BuiltinPlugin {
|
|
728
730
|
name: BindingBuiltinPluginName;
|
|
729
|
-
// NOTE: has `_` to avoid conflict with `options` hook
|
|
730
731
|
_options?: unknown;
|
|
731
732
|
constructor(name: BindingBuiltinPluginName, _options?: unknown);
|
|
732
733
|
}
|
|
733
734
|
declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
734
|
-
|
|
735
|
+
type DynamicImportVarsPluginConfig = Omit<BindingDynamicImportVarsPluginConfig, "include" | "exclude"> & {
|
|
736
|
+
include?: StringOrRegExp | StringOrRegExp[];
|
|
737
|
+
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
738
|
+
};
|
|
739
|
+
declare function dynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
|
|
735
740
|
declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
|
|
736
741
|
declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
|
|
737
742
|
declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
|
|
@@ -788,7 +793,6 @@ declare function withFilter<A, T extends RolldownPluginOption<A>>(pluginOption:
|
|
|
788
793
|
//#endregion
|
|
789
794
|
//#region src/plugin/index.d.ts
|
|
790
795
|
type ModuleSideEffects = boolean | "no-treeshake" | null;
|
|
791
|
-
// ref: https://github.com/microsoft/TypeScript/issues/33471#issuecomment-1376364329
|
|
792
796
|
type ModuleType = "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | (string & {});
|
|
793
797
|
type ImportKind = BindingHookResolveIdExtraArgs["kind"];
|
|
794
798
|
interface CustomPluginOptions {
|
|
@@ -797,8 +801,6 @@ interface CustomPluginOptions {
|
|
|
797
801
|
interface ModuleOptions {
|
|
798
802
|
moduleSideEffects: ModuleSideEffects;
|
|
799
803
|
meta: CustomPluginOptions;
|
|
800
|
-
// flag used to check if user directly modified the `ModuleInfo`
|
|
801
|
-
// this is used to sync state between rust and js
|
|
802
804
|
invalidate?: boolean;
|
|
803
805
|
}
|
|
804
806
|
interface ResolvedId extends ModuleOptions {
|
|
@@ -828,9 +830,7 @@ type RenderedChunkMeta = {
|
|
|
828
830
|
interface FunctionPluginHooks {
|
|
829
831
|
[DEFINED_HOOK_NAMES.onLog]: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => NullValue | boolean;
|
|
830
832
|
[DEFINED_HOOK_NAMES.options]: (this: MinimalPluginContext, options: InputOptions) => NullValue | InputOptions;
|
|
831
|
-
// TODO find a way to make `this: PluginContext` work.
|
|
832
833
|
[DEFINED_HOOK_NAMES.outputOptions]: (this: MinimalPluginContext, options: OutputOptions) => NullValue | OutputOptions;
|
|
833
|
-
// --- Build hooks ---
|
|
834
834
|
[DEFINED_HOOK_NAMES.buildStart]: (this: PluginContext, options: NormalizedInputOptions) => void;
|
|
835
835
|
[DEFINED_HOOK_NAMES.resolveId]: (this: PluginContext, source: string, importer: string | undefined, extraOptions: ResolveIdExtraOptions) => ResolveIdResult;
|
|
836
836
|
/**
|
|
@@ -844,7 +844,6 @@ interface FunctionPluginHooks {
|
|
|
844
844
|
}) => TransformResult;
|
|
845
845
|
[DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
|
|
846
846
|
[DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
|
|
847
|
-
// --- Generate hooks ---
|
|
848
847
|
[DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
|
|
849
848
|
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | {
|
|
850
849
|
code: string;
|
|
@@ -855,7 +854,6 @@ interface FunctionPluginHooks {
|
|
|
855
854
|
[DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
|
|
856
855
|
[DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
|
|
857
856
|
[DEFINED_HOOK_NAMES.closeBundle]: (this: PluginContext) => void;
|
|
858
|
-
// --- watch hooks ---
|
|
859
857
|
[DEFINED_HOOK_NAMES.watchChange]: (this: PluginContext, id: string, event: {
|
|
860
858
|
event: ChangeEvent;
|
|
861
859
|
}) => void;
|
|
@@ -870,13 +868,8 @@ type ObjectHook<T, O = {}> = T | ({
|
|
|
870
868
|
handler: T;
|
|
871
869
|
} & ObjectHookMeta & O);
|
|
872
870
|
type SyncPluginHooks = DefinedHookNames["augmentChunkHash" | "onLog" | "outputOptions"];
|
|
873
|
-
// | 'renderDynamicImport'
|
|
874
|
-
// | 'resolveFileUrl'
|
|
875
|
-
// | 'resolveImportMeta'
|
|
876
871
|
type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
|
|
877
872
|
type FirstPluginHooks = DefinedHookNames["load" | "resolveDynamicImport" | "resolveId"];
|
|
878
|
-
// | 'resolveImportMeta'
|
|
879
|
-
// | 'shouldTransformCachedModule'
|
|
880
873
|
type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform"];
|
|
881
874
|
type AddonHooks = DefinedHookNames["banner" | "footer" | "intro" | "outro"];
|
|
882
875
|
type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
|
|
@@ -903,11 +896,9 @@ type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook<K extends Asyn
|
|
|
903
896
|
type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
|
|
904
897
|
type AddonHook = string | AddonHookFunction;
|
|
905
898
|
interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
|
|
906
|
-
// cacheKey?: string
|
|
907
899
|
name: string;
|
|
908
900
|
}
|
|
909
901
|
interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
|
|
910
|
-
// for inter-plugin communication
|
|
911
902
|
api?: A;
|
|
912
903
|
}
|
|
913
904
|
type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin;
|
|
@@ -920,8 +911,6 @@ type RolldownOutputPluginOption = MaybePromise<NullValue<RolldownOutputPlugin> |
|
|
|
920
911
|
} | false | RolldownOutputPluginOption[]>;
|
|
921
912
|
//#endregion
|
|
922
913
|
//#region src/options/generated/checks-options.d.ts
|
|
923
|
-
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
|
924
|
-
// To edit this generated file you have to edit `tasks/generator/src/generators/checks.rs`
|
|
925
914
|
interface ChecksOptions {
|
|
926
915
|
/**
|
|
927
916
|
* Whether to emit warning when detecting circular dependency
|
|
@@ -982,7 +971,6 @@ interface ChecksOptions {
|
|
|
982
971
|
//#endregion
|
|
983
972
|
//#region src/options/input-options.d.ts
|
|
984
973
|
type InputOption = string | string[] | Record<string, string>;
|
|
985
|
-
// Omit those key that are part of rolldown option
|
|
986
974
|
type OxcTransformOption = Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject">;
|
|
987
975
|
type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
|
|
988
976
|
type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset">;
|
|
@@ -1002,7 +990,11 @@ type HmrOptions = boolean | {
|
|
|
1002
990
|
port?: number;
|
|
1003
991
|
implement?: string;
|
|
1004
992
|
};
|
|
993
|
+
type OptimizationOptions = {
|
|
994
|
+
inlineConst?: boolean;
|
|
995
|
+
};
|
|
1005
996
|
type AttachDebugOptions = "none" | "simple" | "full";
|
|
997
|
+
type ChunkModulesOrder = "exec-order" | "module-id";
|
|
1006
998
|
interface RollupJsxOptions {
|
|
1007
999
|
mode?: "classic" | "automatic" | "preserve";
|
|
1008
1000
|
factory?: string;
|
|
@@ -1061,6 +1053,18 @@ interface InputOptions {
|
|
|
1061
1053
|
resolveNewUrlToAsset?: boolean;
|
|
1062
1054
|
hmr?: HmrOptions;
|
|
1063
1055
|
/**
|
|
1056
|
+
* Control which order should use when rendering modules in chunk
|
|
1057
|
+
*
|
|
1058
|
+
* - Type: `'exec-order' | 'module-id'
|
|
1059
|
+
* - Default: `'exec-order'`
|
|
1060
|
+
*
|
|
1061
|
+
* - `exec-order`: Almost equivalent to the topological order of the module graph, but specially handling when module graph has cycle.
|
|
1062
|
+
* - `module-id`: This is more friendly for gzip compression, especially for some javascript static asset lib (e.g. icon library)
|
|
1063
|
+
* > [!NOTE]
|
|
1064
|
+
* > Try to sort the modules by their module id if possible(Since rolldown scope hoist all modules in the chunk, we only try to sort those modules by module id if we could ensure runtime behavior is correct after sorting).
|
|
1065
|
+
*/
|
|
1066
|
+
chunkModulesOrder?: ChunkModulesOrder;
|
|
1067
|
+
/**
|
|
1064
1068
|
* Attach debug information to the output bundle.
|
|
1065
1069
|
*
|
|
1066
1070
|
* - Type: `'none' | 'simple' | 'full'`
|
|
@@ -1183,6 +1187,7 @@ interface InputOptions {
|
|
|
1183
1187
|
sessionId?: string;
|
|
1184
1188
|
};
|
|
1185
1189
|
preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
|
|
1190
|
+
optimization?: OptimizationOptions;
|
|
1186
1191
|
}
|
|
1187
1192
|
//#endregion
|
|
1188
1193
|
//#region src/types/rolldown-options.d.ts
|
|
@@ -1201,4 +1206,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
|
1201
1206
|
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
1202
1207
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
1203
1208
|
//#endregion
|
|
1204
|
-
export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, 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, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
|
|
1209
|
+
export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DDkG_k5U.cjs');
|
|
2
|
-
const require_src = require('./src-
|
|
2
|
+
const require_src = require('./src-Dtgcnc61.cjs');
|
|
3
3
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
4
4
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
5
5
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
@@ -102,7 +102,7 @@ function locate(source, search, options) {
|
|
|
102
102
|
|
|
103
103
|
//#endregion
|
|
104
104
|
//#region src/log/logs.ts
|
|
105
|
-
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR";
|
|
105
|
+
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG";
|
|
106
106
|
function logParseError(message) {
|
|
107
107
|
return {
|
|
108
108
|
code: PARSE_ERROR,
|
|
@@ -133,6 +133,12 @@ function logMultiplyNotifyOption() {
|
|
|
133
133
|
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
+
function logDuplicateJsxConfig() {
|
|
137
|
+
return {
|
|
138
|
+
code: DUPLICATE_JSX_CONFIG,
|
|
139
|
+
message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
|
|
140
|
+
};
|
|
141
|
+
}
|
|
136
142
|
function logPluginError(error$1, plugin, { hook, id } = {}) {
|
|
137
143
|
try {
|
|
138
144
|
const code = error$1.code;
|
|
@@ -181,7 +187,7 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
181
187
|
}
|
|
182
188
|
|
|
183
189
|
//#endregion
|
|
184
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
190
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.76.0/node_modules/oxc-parser/wrap.mjs
|
|
185
191
|
function wrap$1(result) {
|
|
186
192
|
let program, module$1, comments, errors;
|
|
187
193
|
return {
|
|
@@ -276,6 +282,12 @@ Object.defineProperty(exports, 'logCycleLoading', {
|
|
|
276
282
|
return logCycleLoading;
|
|
277
283
|
}
|
|
278
284
|
});
|
|
285
|
+
Object.defineProperty(exports, 'logDuplicateJsxConfig', {
|
|
286
|
+
enumerable: true,
|
|
287
|
+
get: function () {
|
|
288
|
+
return logDuplicateJsxConfig;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
279
291
|
Object.defineProperty(exports, 'logInputHookInOutputPlugin', {
|
|
280
292
|
enumerable: true,
|
|
281
293
|
get: function () {
|
|
@@ -101,7 +101,7 @@ function locate(source, search, options) {
|
|
|
101
101
|
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/log/logs.ts
|
|
104
|
-
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR";
|
|
104
|
+
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG";
|
|
105
105
|
function logParseError(message) {
|
|
106
106
|
return {
|
|
107
107
|
code: PARSE_ERROR,
|
|
@@ -132,6 +132,12 @@ function logMultiplyNotifyOption() {
|
|
|
132
132
|
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
+
function logDuplicateJsxConfig() {
|
|
136
|
+
return {
|
|
137
|
+
code: DUPLICATE_JSX_CONFIG,
|
|
138
|
+
message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
|
|
139
|
+
};
|
|
140
|
+
}
|
|
135
141
|
function logPluginError(error$1, plugin, { hook, id } = {}) {
|
|
136
142
|
try {
|
|
137
143
|
const code = error$1.code;
|
|
@@ -180,7 +186,7 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
180
186
|
}
|
|
181
187
|
|
|
182
188
|
//#endregion
|
|
183
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
189
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.76.0/node_modules/oxc-parser/wrap.mjs
|
|
184
190
|
function wrap$1(result) {
|
|
185
191
|
let program, module, comments, errors;
|
|
186
192
|
return {
|
|
@@ -257,4 +263,4 @@ async function parseAstAsync(sourceText, options, filename) {
|
|
|
257
263
|
}
|
|
258
264
|
|
|
259
265
|
//#endregion
|
|
260
|
-
export { augmentCodeLocation, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, parseAstAsync };
|
|
266
|
+
export { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, parseAstAsync };
|