@rolldown/browser 1.0.0-beta.21 → 1.0.0-beta.23
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 +3 -3
- package/dist/cli.mjs +3 -3
- 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 +2 -2
- package/dist/experimental-index.cjs +2 -3
- package/dist/experimental-index.d.cts +3 -6
- package/dist/experimental-index.d.mts +3 -6
- package/dist/experimental-index.mjs +3 -3
- package/dist/filter-index.cjs +1 -1
- package/dist/filter-index.d.cts +2 -2
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- 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 +3 -3
- package/dist/parallel-plugin-worker.mjs +3 -3
- package/dist/parallel-plugin.d.cts +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.cts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/rolldown-binding.wasi-browser.js +1 -0
- package/dist/rolldown-binding.wasi.cjs +1 -0
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding--Ro_HG7S.d.mts → binding-CMKStSph.d.cts} +5 -1
- package/dist/shared/{binding-DBnJxycu.d.cts → binding-DB58iXP8.d.mts} +5 -1
- package/dist/shared/{define-config-3jyxkSn6.d.mts → define-config-BRkYSF9E.d.cts} +30 -30
- package/dist/shared/{define-config-LuFmoc43.d.cts → define-config-CqVfqfZQ.d.mts} +30 -30
- package/dist/shared/{dist-BMVjvV-v.cjs → dist-BVAp8sOm.cjs} +0 -9
- package/dist/shared/{dist-BoWaIc-K.mjs → dist-DvBwroyk.mjs} +1 -4
- package/dist/shared/{load-config-DnUMpIsk.mjs → load-config-BWbXOTbl.mjs} +1 -1
- package/dist/shared/{load-config--g9e2MRO.cjs → load-config-Bh2dNRk9.cjs} +1 -1
- package/dist/shared/{src-DLhNmBff.mjs → src-BA5CL--T.mjs} +354 -635
- package/dist/shared/{src-B3ZW8_Y7.cjs → src-Co_Bf7DL.cjs} +353 -640
- package/dist/{src-jKfrtJ37.js → src-C1KTaRyZ.js} +383 -667
- package/package.json +1 -1
|
@@ -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, 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-DB58iXP8.mjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
|
|
@@ -42,6 +42,22 @@ type LogOrStringHandler = (level: LogLevelWithError, log: RollupLogWithString) =
|
|
|
42
42
|
type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string;
|
|
43
43
|
type SourcemapIgnoreListOption = (relativeSourcePath: string, sourcemapPath: string) => boolean;
|
|
44
44
|
//#endregion
|
|
45
|
+
//#region src/types/module-info.d.ts
|
|
46
|
+
interface ModuleInfo extends ModuleOptions {
|
|
47
|
+
/**
|
|
48
|
+
* Unsupported at rolldown
|
|
49
|
+
*/
|
|
50
|
+
ast: any;
|
|
51
|
+
code: string | null;
|
|
52
|
+
id: string;
|
|
53
|
+
importers: string[];
|
|
54
|
+
dynamicImporters: string[];
|
|
55
|
+
importedIds: string[];
|
|
56
|
+
dynamicallyImportedIds: string[];
|
|
57
|
+
exports: string[];
|
|
58
|
+
isEntry: boolean;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
45
61
|
//#region src/utils/asset-source.d.ts
|
|
46
62
|
type AssetSource = string | Uint8Array;
|
|
47
63
|
//#endregion
|
|
@@ -133,6 +149,9 @@ interface PreRenderedAsset {
|
|
|
133
149
|
type AssetFileNamesFunction = (chunkInfo: PreRenderedAsset) => string;
|
|
134
150
|
type GlobalsFunction = (name: string) => string;
|
|
135
151
|
type MinifyOptions = BindingMinifyOptions;
|
|
152
|
+
interface ChunkingContext {
|
|
153
|
+
getModuleInfo(moduleId: string): ModuleInfo | null;
|
|
154
|
+
}
|
|
136
155
|
interface OutputOptions {
|
|
137
156
|
dir?: string;
|
|
138
157
|
file?: string;
|
|
@@ -170,7 +189,7 @@ interface OutputOptions {
|
|
|
170
189
|
externalLiveBindings?: boolean;
|
|
171
190
|
inlineDynamicImports?: boolean;
|
|
172
191
|
/**
|
|
173
|
-
* - Type: `((moduleId: string) => string | NullValue)`
|
|
192
|
+
* - Type: `((moduleId: string, meta: { getModuleInfo: (moduleId: string) => ModuleInfo | null }) => string | NullValue)`
|
|
174
193
|
* - Object form is not supported.
|
|
175
194
|
*
|
|
176
195
|
* :::warning
|
|
@@ -213,7 +232,9 @@ interface OutputOptions {
|
|
|
213
232
|
*
|
|
214
233
|
* @deprecated Please use `advancedChunks` instead.
|
|
215
234
|
*/
|
|
216
|
-
manualChunks?: (moduleId: string, meta: {
|
|
235
|
+
manualChunks?: (moduleId: string, meta: {
|
|
236
|
+
getModuleInfo: (moduleId: string) => ModuleInfo | null;
|
|
237
|
+
}) => string | NullValue;
|
|
217
238
|
/**
|
|
218
239
|
* Allows you to do manual chunking. For deeper understanding, please refer to the in-depth [documentation](https://rolldown.rs/guide/in-depth/advanced-chunks).
|
|
219
240
|
*/
|
|
@@ -253,7 +274,7 @@ interface OutputOptions {
|
|
|
253
274
|
*/
|
|
254
275
|
groups?: {
|
|
255
276
|
/**
|
|
256
|
-
* - Type: `string | ((moduleId: string) => string | NullValue)`
|
|
277
|
+
* - Type: `string | ((moduleId: string, ctx: { getModuleInfo: (moduleId: string) => ModuleInfo | null }) => string | NullValue)`
|
|
257
278
|
*
|
|
258
279
|
* Name of the group. It will be also used as the name of the chunk and replaced the `[name]` placeholder in the `chunkFileNames` option.
|
|
259
280
|
*
|
|
@@ -304,7 +325,7 @@ interface OutputOptions {
|
|
|
304
325
|
* Constraints like `minSize`, `maxSize`, etc. are applied separately for different names returned by the function.
|
|
305
326
|
* :::
|
|
306
327
|
*/
|
|
307
|
-
name: string | ((moduleId: string) => string | NullValue);
|
|
328
|
+
name: string | ((moduleId: string, ctx: ChunkingContext) => string | NullValue);
|
|
308
329
|
/**
|
|
309
330
|
* - Type: `string | RegExp | ((id: string) => boolean | undefined | void);`
|
|
310
331
|
*
|
|
@@ -618,22 +639,6 @@ type ParallelPlugin = {
|
|
|
618
639
|
type DefineParallelPluginResult<Options> = (options: Options) => ParallelPlugin;
|
|
619
640
|
declare function defineParallelPlugin<Options>(pluginPath: string): DefineParallelPluginResult<Options>;
|
|
620
641
|
//#endregion
|
|
621
|
-
//#region src/types/module-info.d.ts
|
|
622
|
-
interface ModuleInfo extends ModuleOptions {
|
|
623
|
-
/**
|
|
624
|
-
* Unsupported at rolldown
|
|
625
|
-
*/
|
|
626
|
-
ast: any;
|
|
627
|
-
code: string | null;
|
|
628
|
-
id: string;
|
|
629
|
-
importers: string[];
|
|
630
|
-
dynamicImporters: string[];
|
|
631
|
-
importedIds: string[];
|
|
632
|
-
dynamicallyImportedIds: string[];
|
|
633
|
-
exports: string[];
|
|
634
|
-
isEntry: boolean;
|
|
635
|
-
}
|
|
636
|
-
//#endregion
|
|
637
642
|
//#region src/plugin/plugin-context.d.ts
|
|
638
643
|
interface EmittedAsset {
|
|
639
644
|
type: "asset";
|
|
@@ -694,6 +699,7 @@ type TreeshakingOptions = {
|
|
|
694
699
|
annotations?: boolean;
|
|
695
700
|
manualPureFunctions?: string[];
|
|
696
701
|
unknownGlobalSideEffects?: boolean;
|
|
702
|
+
commonjs?: boolean;
|
|
697
703
|
} | boolean;
|
|
698
704
|
//#endregion
|
|
699
705
|
//#region src/types/output-bundle.d.ts
|
|
@@ -729,7 +735,7 @@ declare function dynamicImportVarsPlugin(config?: BindingDynamicImportVarsPlugin
|
|
|
729
735
|
declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
|
|
730
736
|
declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
|
|
731
737
|
declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
|
|
732
|
-
declare function wasmHelperPlugin(): BuiltinPlugin;
|
|
738
|
+
declare function wasmHelperPlugin(config?: BindingWasmHelperPluginConfig): BuiltinPlugin;
|
|
733
739
|
declare function wasmFallbackPlugin(): BuiltinPlugin;
|
|
734
740
|
declare function loadFallbackPlugin(): BuiltinPlugin;
|
|
735
741
|
declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
|
|
@@ -748,11 +754,6 @@ declare function webWorkerPostPlugin(): BuiltinPlugin;
|
|
|
748
754
|
declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
|
|
749
755
|
declare const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES: readonly ["augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle"];
|
|
750
756
|
declare const ENUMERATED_PLUGIN_HOOK_NAMES: [...typeof ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ...typeof ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES, "footer", "banner", "intro", "outro"];
|
|
751
|
-
type EnumeratedPluginHookNames = typeof ENUMERATED_PLUGIN_HOOK_NAMES;
|
|
752
|
-
/**
|
|
753
|
-
* Names of all hooks in a `Plugin` object. Does not include `name` and `api`, since they are not hooks.
|
|
754
|
-
*/
|
|
755
|
-
type PluginHookNames = EnumeratedPluginHookNames[number];
|
|
756
757
|
/**
|
|
757
758
|
* Names of all defined hooks. It's like
|
|
758
759
|
* ```ts
|
|
@@ -763,7 +764,7 @@ type PluginHookNames = EnumeratedPluginHookNames[number];
|
|
|
763
764
|
* }
|
|
764
765
|
* ```
|
|
765
766
|
*/
|
|
766
|
-
type DefinedHookNames = { readonly [K in
|
|
767
|
+
type DefinedHookNames = { readonly [K in typeof ENUMERATED_PLUGIN_HOOK_NAMES[number]]: K };
|
|
767
768
|
/**
|
|
768
769
|
* Names of all defined hooks. It's like
|
|
769
770
|
* ```js
|
|
@@ -1054,7 +1055,6 @@ interface InputOptions {
|
|
|
1054
1055
|
onwarn?: (warning: RollupLog, defaultHandler: (warning: RollupLogWithString | (() => RollupLogWithString)) => void) => void;
|
|
1055
1056
|
moduleTypes?: ModuleTypes;
|
|
1056
1057
|
experimental?: {
|
|
1057
|
-
enableComposingJsPlugins?: boolean;
|
|
1058
1058
|
strictExecutionOrder?: boolean;
|
|
1059
1059
|
disableLiveBindings?: boolean;
|
|
1060
1060
|
viteMode?: boolean;
|
|
@@ -1201,4 +1201,4 @@ declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
|
1201
1201
|
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
1202
1202
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
1203
1203
|
//#endregion
|
|
1204
|
-
export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, 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 };
|
|
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 };
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
function arraify(value) {
|
|
4
4
|
return Array.isArray(value) ? value : [value];
|
|
5
5
|
}
|
|
6
|
-
function isNullish(value) {
|
|
7
|
-
return value === null || value === void 0;
|
|
8
|
-
}
|
|
9
6
|
function isPromiseLike(value) {
|
|
10
7
|
return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
11
8
|
}
|
|
@@ -181,12 +178,6 @@ Object.defineProperty(exports, 'include', {
|
|
|
181
178
|
return include;
|
|
182
179
|
}
|
|
183
180
|
});
|
|
184
|
-
Object.defineProperty(exports, 'isNullish', {
|
|
185
|
-
enumerable: true,
|
|
186
|
-
get: function () {
|
|
187
|
-
return isNullish;
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
181
|
Object.defineProperty(exports, 'isPromiseLike', {
|
|
191
182
|
enumerable: true,
|
|
192
183
|
get: function () {
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
function arraify(value) {
|
|
3
3
|
return Array.isArray(value) ? value : [value];
|
|
4
4
|
}
|
|
5
|
-
function isNullish(value) {
|
|
6
|
-
return value === null || value === void 0;
|
|
7
|
-
}
|
|
8
5
|
function isPromiseLike(value) {
|
|
9
6
|
return value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
10
7
|
}
|
|
@@ -144,4 +141,4 @@ function queries(queryFilter) {
|
|
|
144
141
|
}
|
|
145
142
|
|
|
146
143
|
//#endregion
|
|
147
|
-
export { and, arraify, code, exclude, id, include,
|
|
144
|
+
export { and, arraify, code, exclude, id, include, isPromiseLike, moduleType, noop, not, or, queries, query, unimplemented, unreachable, unsupported };
|
|
@@ -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-Co_Bf7DL.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"));
|