rolldown 1.0.0-beta.42 → 1.0.0-beta.43
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.mjs +10 -5
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.d.mts +10 -4
- package/dist/experimental-index.mjs +21 -4
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/shared/{binding-CtbNz6TD.d.mts → binding-BkaKdpud.d.mts} +20 -4
- package/dist/shared/{define-config-C9Rp3knL.d.mts → define-config-BGtNx9V_.d.mts} +60 -3
- package/dist/shared/{load-config-a7bPxI7K.mjs → load-config-CLB1MN5j.mjs} +1 -1
- package/dist/shared/{parse-ast-index-DHblAIjN.mjs → parse-ast-index-DkUtf7vl.mjs} +33 -34
- package/dist/shared/{src-CUdyD4rb.mjs → src-DucjDcdj.mjs} +56 -10
- package/package.json +17 -17
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./shared/parse-ast-index-
|
|
2
|
-
import { description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, onExit, rolldown, validateCliOptions, version, watch } from "./shared/src-
|
|
1
|
+
import { createTokioRuntime } from "./shared/parse-ast-index-DkUtf7vl.mjs";
|
|
2
|
+
import { description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, onExit, rolldown, validateCliOptions, version, watch } from "./shared/src-DucjDcdj.mjs";
|
|
3
3
|
import { arraify } from "./shared/misc-CQeo-AFx.mjs";
|
|
4
4
|
import { logger } from "./shared/logger-B83ocDok.mjs";
|
|
5
|
-
import { loadConfig } from "./shared/load-config-
|
|
5
|
+
import { loadConfig } from "./shared/load-config-CLB1MN5j.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import colors from "ansis";
|
|
8
8
|
import { parseArgs } from "node:util";
|
|
@@ -313,8 +313,13 @@ async function bundleWithConfig(configPath, cliOptions, rawArgs = {}) {
|
|
|
313
313
|
process.exit(1);
|
|
314
314
|
}
|
|
315
315
|
const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
|
|
316
|
-
if (cliOptions.watch)
|
|
317
|
-
|
|
316
|
+
if (cliOptions.watch) {
|
|
317
|
+
createTokioRuntime(32);
|
|
318
|
+
await watchInner(resolvedConfig, cliOptions);
|
|
319
|
+
} else {
|
|
320
|
+
createTokioRuntime(4);
|
|
321
|
+
await bundleInner(resolvedConfig, cliOptions);
|
|
322
|
+
}
|
|
318
323
|
}
|
|
319
324
|
async function bundleWithCliOptions(cliOptions) {
|
|
320
325
|
try {
|
package/dist/config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { ConfigExport, defineConfig } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-BkaKdpud.mjs";
|
|
2
|
+
import { ConfigExport, defineConfig } from "./shared/define-config-BGtNx9V_.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/load-config.d.ts
|
|
5
5
|
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
package/dist/config.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./shared/parse-ast-index-
|
|
2
|
-
import { defineConfig, version } from "./shared/src-
|
|
1
|
+
import "./shared/parse-ast-index-DkUtf7vl.mjs";
|
|
2
|
+
import { defineConfig, version } from "./shared/src-DucjDcdj.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
|
-
import { loadConfig } from "./shared/load-config-
|
|
4
|
+
import { loadConfig } from "./shared/load-config-CLB1MN5j.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/config.ts
|
|
7
7
|
const VERSION = version;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, BindingRebuildStrategy, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-
|
|
2
|
-
import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-
|
|
1
|
+
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingOutputs, BindingReactRefreshWrapperPluginConfig, BindingRebuildStrategy, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-BkaKdpud.mjs";
|
|
2
|
+
import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-BGtNx9V_.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/dev/dev-options.d.ts
|
|
5
|
+
type DevOnHmrUpdates = (result: Error | {
|
|
6
|
+
updates: BindingClientHmrUpdate[];
|
|
7
|
+
changedFiles: string[];
|
|
8
|
+
}) => void | Promise<void>;
|
|
9
|
+
type DevOnOutput = (result: Error | BindingOutputs) => void | Promise<void>;
|
|
5
10
|
interface DevWatchOptions {
|
|
6
11
|
/**
|
|
7
12
|
* If `true`, files are not written to disk.
|
|
@@ -43,7 +48,8 @@ interface DevWatchOptions {
|
|
|
43
48
|
debounceTickRate?: number;
|
|
44
49
|
}
|
|
45
50
|
interface DevOptions {
|
|
46
|
-
onHmrUpdates?:
|
|
51
|
+
onHmrUpdates?: DevOnHmrUpdates;
|
|
52
|
+
onOutput?: DevOnOutput;
|
|
47
53
|
/**
|
|
48
54
|
* Strategy for triggering rebuilds after HMR updates.
|
|
49
55
|
* - `'always'`: Always trigger a rebuild after HMR updates
|
|
@@ -152,4 +158,4 @@ type TransformPluginConfig = Omit<BindingTransformPluginConfig, "include" | "exc
|
|
|
152
158
|
};
|
|
153
159
|
declare function transformPlugin(config?: TransformPluginConfig): BuiltinPlugin;
|
|
154
160
|
//#endregion
|
|
155
|
-
export { BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
161
|
+
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./shared/src-
|
|
1
|
+
import { BindingDevEngine, BindingRebuildStrategy, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/parse-ast-index-DkUtf7vl.mjs";
|
|
2
|
+
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizeBindingResult, normalizedStringOrRegex } from "./shared/src-DucjDcdj.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
4
|
import { logger } from "./shared/logger-B83ocDok.mjs";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
@@ -11,8 +11,25 @@ var DevEngine = class DevEngine {
|
|
|
11
11
|
static async create(inputOptions, outputOptions = {}, devOptions = {}) {
|
|
12
12
|
inputOptions = await PluginDriver.callOptionsHook(inputOptions);
|
|
13
13
|
const options = await createBundlerOptions(inputOptions, outputOptions, false);
|
|
14
|
+
const userOnHmrUpdates = devOptions.onHmrUpdates;
|
|
15
|
+
const bindingOnHmrUpdates = userOnHmrUpdates ? function(rawResult) {
|
|
16
|
+
const result = normalizeBindingResult(rawResult);
|
|
17
|
+
if (result instanceof Error) {
|
|
18
|
+
userOnHmrUpdates(result);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const [updates, changedFiles] = result;
|
|
22
|
+
userOnHmrUpdates({
|
|
23
|
+
updates,
|
|
24
|
+
changedFiles
|
|
25
|
+
});
|
|
26
|
+
} : void 0;
|
|
27
|
+
const userOnOutput = devOptions.onOutput;
|
|
14
28
|
const bindingDevOptions = {
|
|
15
|
-
onHmrUpdates:
|
|
29
|
+
onHmrUpdates: bindingOnHmrUpdates,
|
|
30
|
+
onOutput: userOnOutput ? function(rawResult) {
|
|
31
|
+
userOnOutput(normalizeBindingResult(rawResult));
|
|
32
|
+
} : void 0,
|
|
16
33
|
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? BindingRebuildStrategy.Always : devOptions.rebuildStrategy === "auto" ? BindingRebuildStrategy.Auto : BindingRebuildStrategy.Never : void 0,
|
|
17
34
|
watch: devOptions.watch && {
|
|
18
35
|
skipWrite: devOptions.watch.skipWrite,
|
|
@@ -210,4 +227,4 @@ function transformPlugin(config) {
|
|
|
210
227
|
}
|
|
211
228
|
|
|
212
229
|
//#endregion
|
|
213
|
-
export {
|
|
230
|
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { withFilter } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-BkaKdpud.mjs";
|
|
2
|
+
import { withFilter } from "./shared/define-config-BGtNx9V_.mjs";
|
|
3
3
|
import { and, code, exclude, id, include, moduleType, not, or, queries, query } from "@rolldown/pluginutils";
|
|
4
4
|
export { and, code, exclude, id, include, moduleType, not, or, queries, query, withFilter };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PreRenderedChunk } from "./shared/binding-
|
|
2
|
-
import { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, 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, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-
|
|
3
|
-
export { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
|
1
|
+
import { BindingMagicString, PreRenderedChunk } from "./shared/binding-BkaKdpud.mjs";
|
|
2
|
+
import { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, 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, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-BGtNx9V_.mjs";
|
|
3
|
+
export { AddonFunction, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/parse-ast-index-
|
|
2
|
-
import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-
|
|
1
|
+
import { BindingMagicString } from "./shared/parse-ast-index-DkUtf7vl.mjs";
|
|
2
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-DucjDcdj.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
4
|
|
|
5
|
-
export { VERSION, build, defineConfig, rolldown, watch };
|
|
5
|
+
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { registerPlugins } from "./shared/parse-ast-index-
|
|
2
|
-
import { PluginContextData, bindingifyPlugin } from "./shared/src-
|
|
1
|
+
import { registerPlugins } from "./shared/parse-ast-index-DkUtf7vl.mjs";
|
|
2
|
+
import { PluginContextData, bindingifyPlugin } from "./shared/src-DucjDcdj.mjs";
|
|
3
3
|
import "./shared/misc-CQeo-AFx.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { MaybePromise, Plugin } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-BkaKdpud.mjs";
|
|
2
|
+
import { MaybePromise, Plugin } from "./shared/define-config-BGtNx9V_.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
5
5
|
type ParallelPluginImplementation = Plugin;
|
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -1164,9 +1164,21 @@ declare class BindingBundlerImpl {
|
|
|
1164
1164
|
get closed(): boolean;
|
|
1165
1165
|
getWatchFiles(): Promise<Array<string>>;
|
|
1166
1166
|
}
|
|
1167
|
-
declare class
|
|
1168
|
-
|
|
1169
|
-
|
|
1167
|
+
declare class BindingMagicString {
|
|
1168
|
+
constructor(source: string);
|
|
1169
|
+
replace(from: string, to: string): void;
|
|
1170
|
+
replaceAll(from: string, to: string): void;
|
|
1171
|
+
prepend(content: string): void;
|
|
1172
|
+
append(content: string): void;
|
|
1173
|
+
prependLeft(index: number, content: string): void;
|
|
1174
|
+
prependRight(index: number, content: string): void;
|
|
1175
|
+
appendLeft(index: number, content: string): void;
|
|
1176
|
+
appendRight(index: number, content: string): void;
|
|
1177
|
+
overwrite(start: number, end: number, content: string): void;
|
|
1178
|
+
toString(): string;
|
|
1179
|
+
hasChanged(): boolean;
|
|
1180
|
+
length(): number;
|
|
1181
|
+
isEmpty(): boolean;
|
|
1170
1182
|
}
|
|
1171
1183
|
declare class BindingOutputAsset {
|
|
1172
1184
|
get fileName(): string;
|
|
@@ -1246,6 +1258,10 @@ interface BindingBuildImportAnalysisPluginConfig {
|
|
|
1246
1258
|
isRelativeBase: boolean;
|
|
1247
1259
|
}
|
|
1248
1260
|
type BindingBuiltinPluginName = 'builtin:alias' | 'builtin:asset' | 'builtin:asset-import-meta-url' | 'builtin:build-import-analysis' | 'builtin:dynamic-import-vars' | 'builtin:import-glob' | 'builtin:isolated-declaration' | 'builtin:json' | 'builtin:load-fallback' | 'builtin:manifest' | 'builtin:module-preload-polyfill' | 'builtin:react-refresh-wrapper' | 'builtin:reporter' | 'builtin:replace' | 'builtin:esm-external-require' | 'builtin:transform' | 'builtin:vite-resolve' | 'builtin:wasm-fallback' | 'builtin:wasm-helper' | 'builtin:web-worker-post';
|
|
1261
|
+
interface BindingClientHmrUpdate {
|
|
1262
|
+
clientId: string;
|
|
1263
|
+
update: BindingHmrUpdate;
|
|
1264
|
+
}
|
|
1249
1265
|
interface BindingDynamicImportVarsPluginConfig {
|
|
1250
1266
|
include?: Array<BindingStringOrRegex>;
|
|
1251
1267
|
exclude?: Array<BindingStringOrRegex>;
|
|
@@ -1417,4 +1433,4 @@ interface PreRenderedChunk {
|
|
|
1417
1433
|
exports: Array<string>;
|
|
1418
1434
|
}
|
|
1419
1435
|
//#endregion
|
|
1420
|
-
export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, BindingRebuildStrategy, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, MinifyOptions, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
|
|
1436
|
+
export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingMagicString, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingOutputs, BindingReactRefreshWrapperPluginConfig, BindingRebuildStrategy, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, MinifyOptions, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-
|
|
1
|
+
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHookResolveIdExtraArgs, BindingMagicString, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-BkaKdpud.mjs";
|
|
2
2
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
3
3
|
import { Program } from "@oxc-project/types";
|
|
4
4
|
|
|
@@ -253,6 +253,37 @@ interface OutputOptions {
|
|
|
253
253
|
minify?: boolean | "dce-only" | MinifyOptions;
|
|
254
254
|
name?: string;
|
|
255
255
|
globals?: Record<string, string> | GlobalsFunction;
|
|
256
|
+
/**
|
|
257
|
+
* Maps external module IDs to paths.
|
|
258
|
+
*
|
|
259
|
+
* Allows customizing the path used when importing external dependencies.
|
|
260
|
+
* This is particularly useful for loading dependencies from CDNs or custom locations.
|
|
261
|
+
*
|
|
262
|
+
* - Object form: Maps module IDs to their replacement paths
|
|
263
|
+
* - Function form: Takes a module ID and returns its replacement path
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```js
|
|
267
|
+
* {
|
|
268
|
+
* paths: {
|
|
269
|
+
* 'd3': 'https://cdn.jsdelivr.net/npm/d3@7'
|
|
270
|
+
* }
|
|
271
|
+
* }
|
|
272
|
+
* ```
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```js
|
|
276
|
+
* {
|
|
277
|
+
* paths: (id) => {
|
|
278
|
+
* if (id.startsWith('lodash')) {
|
|
279
|
+
* return `https://cdn.jsdelivr.net/npm/${id}`
|
|
280
|
+
* }
|
|
281
|
+
* return id
|
|
282
|
+
* }
|
|
283
|
+
* }
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
286
|
+
paths?: Record<string, string> | ((id: string) => string);
|
|
256
287
|
generatedCode?: Partial<GeneratedCodeOptions>;
|
|
257
288
|
externalLiveBindings?: boolean;
|
|
258
289
|
inlineDynamicImports?: boolean;
|
|
@@ -314,7 +345,7 @@ interface OutputOptions {
|
|
|
314
345
|
* By default, each group will also include captured modules' dependencies. This reduces the chance of generating circular chunks.
|
|
315
346
|
*
|
|
316
347
|
* If you want to disable this behavior, it's recommended to both set
|
|
317
|
-
* - `preserveEntrySignatures: false`
|
|
348
|
+
* - `preserveEntrySignatures: false | 'allow-extension'`
|
|
318
349
|
* - `strictExecutionOrder: true`
|
|
319
350
|
*
|
|
320
351
|
* to avoid generating invalid chunks.
|
|
@@ -612,6 +643,7 @@ interface NormalizedInputOptions {
|
|
|
612
643
|
}
|
|
613
644
|
//#endregion
|
|
614
645
|
//#region src/options/normalized-output-options.d.ts
|
|
646
|
+
type PathsFunction = (id: string) => string;
|
|
615
647
|
type InternalModuleFormat = "es" | "cjs" | "iife" | "umd";
|
|
616
648
|
interface NormalizedOutputOptions {
|
|
617
649
|
name: string | undefined;
|
|
@@ -635,6 +667,7 @@ interface NormalizedOutputOptions {
|
|
|
635
667
|
esModule: boolean | "if-default-prop";
|
|
636
668
|
extend: boolean;
|
|
637
669
|
globals: Record<string, string> | GlobalsFunction;
|
|
670
|
+
paths: Record<string, string> | PathsFunction | undefined;
|
|
638
671
|
hashCharacters: "base64" | "base36" | "hex";
|
|
639
672
|
sourcemapDebugIds: boolean;
|
|
640
673
|
sourcemapIgnoreList: boolean | SourcemapIgnoreListOption | StringOrRegExp | undefined;
|
|
@@ -952,7 +985,9 @@ interface ResolveIdExtraOptions {
|
|
|
952
985
|
}
|
|
953
986
|
type ResolveIdResult = string | NullValue | false | PartialResolvedId;
|
|
954
987
|
type LoadResult = NullValue | string | SourceDescription;
|
|
955
|
-
type TransformResult = NullValue | string |
|
|
988
|
+
type TransformResult = NullValue | string | Omit<SourceDescription, "code"> & {
|
|
989
|
+
code?: string | BindingMagicString;
|
|
990
|
+
};
|
|
956
991
|
type RenderedChunkMeta = {
|
|
957
992
|
chunks: Record<string, RenderedChunk>;
|
|
958
993
|
};
|
|
@@ -970,6 +1005,7 @@ interface FunctionPluginHooks {
|
|
|
970
1005
|
[DEFINED_HOOK_NAMES.load]: (this: PluginContext, id: string) => MaybePromise<LoadResult>;
|
|
971
1006
|
[DEFINED_HOOK_NAMES.transform]: (this: TransformPluginContext, code: string, id: string, meta: BindingTransformHookExtraArgs & {
|
|
972
1007
|
moduleType: ModuleType;
|
|
1008
|
+
magicString?: BindingMagicString;
|
|
973
1009
|
}) => TransformResult;
|
|
974
1010
|
[DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
|
|
975
1011
|
[DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
|
|
@@ -1238,6 +1274,17 @@ interface InputOptions {
|
|
|
1238
1274
|
onwarn?: (warning: RollupLog, defaultHandler: (warning: RollupLogWithString | (() => RollupLogWithString)) => void) => void;
|
|
1239
1275
|
moduleTypes?: ModuleTypes;
|
|
1240
1276
|
experimental?: {
|
|
1277
|
+
/**
|
|
1278
|
+
* Lets modules be executed in the order they are declared.
|
|
1279
|
+
*
|
|
1280
|
+
* - Type: `boolean`
|
|
1281
|
+
* - Default: `false`
|
|
1282
|
+
*
|
|
1283
|
+
* This is done by injecting runtime helpers to ensure that modules are executed in the order they are imported. External modules won't be affected.
|
|
1284
|
+
*
|
|
1285
|
+
* > [!WARNING]
|
|
1286
|
+
* > Enabling this option may negatively increase bundle size. It is recommended to use this option only when absolutely necessary.
|
|
1287
|
+
*/
|
|
1241
1288
|
strictExecutionOrder?: boolean;
|
|
1242
1289
|
disableLiveBindings?: boolean;
|
|
1243
1290
|
viteMode?: boolean;
|
|
@@ -1326,6 +1373,16 @@ interface InputOptions {
|
|
|
1326
1373
|
*/
|
|
1327
1374
|
incrementalBuild?: boolean;
|
|
1328
1375
|
transformHiresSourcemap?: boolean | "boundary";
|
|
1376
|
+
/**
|
|
1377
|
+
* Use native Rust implementation of MagicString for source map generation.
|
|
1378
|
+
*
|
|
1379
|
+
* - Type: `boolean`
|
|
1380
|
+
* - Default: `false`
|
|
1381
|
+
*
|
|
1382
|
+
* When enabled, rolldown will use a native Rust implementation of MagicString
|
|
1383
|
+
* for better performance during source map generation.
|
|
1384
|
+
*/
|
|
1385
|
+
nativeMagicString?: boolean;
|
|
1329
1386
|
};
|
|
1330
1387
|
/**
|
|
1331
1388
|
* Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
|
|
@@ -9848,8 +9848,8 @@ var init_wasm_util_esm_bundler = __esm({ "../../node_modules/.pnpm/@tybys+wasm-u
|
|
|
9848
9848
|
}) });
|
|
9849
9849
|
|
|
9850
9850
|
//#endregion
|
|
9851
|
-
//#region ../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.
|
|
9852
|
-
var require_fs_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.
|
|
9851
|
+
//#region ../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.7/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs
|
|
9852
|
+
var require_fs_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.7/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs": ((exports) => {
|
|
9853
9853
|
/**
|
|
9854
9854
|
* @param {unknown} value
|
|
9855
9855
|
*/
|
|
@@ -10045,8 +10045,8 @@ var require_fs_proxy = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@n
|
|
|
10045
10045
|
}) });
|
|
10046
10046
|
|
|
10047
10047
|
//#endregion
|
|
10048
|
-
//#region ../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.
|
|
10049
|
-
var require_runtime = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.
|
|
10048
|
+
//#region ../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.7/node_modules/@napi-rs/wasm-runtime/runtime.cjs
|
|
10049
|
+
var require_runtime = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/@napi-rs+wasm-runtime@1.0.7/node_modules/@napi-rs/wasm-runtime/runtime.cjs": ((exports, module) => {
|
|
10050
10050
|
const { MessageHandler, instantiateNapiModuleSync, instantiateNapiModule } = (init_emnapi_core_esm_bundler(), __toCommonJS(emnapi_core_esm_bundler_exports));
|
|
10051
10051
|
const { getDefaultContext } = (init_emnapi_esm_bundler(), __toCommonJS(emnapi_esm_bundler_exports));
|
|
10052
10052
|
const { WASI } = (init_wasm_util_esm_bundler(), __toCommonJS(wasm_util_esm_bundler_exports));
|
|
@@ -10152,9 +10152,7 @@ var require_rolldown_binding_wasi = /* @__PURE__ */ __commonJS({ "src/rolldown-b
|
|
|
10152
10152
|
module.exports.BindingBundlerImpl = __napiModule.exports.BindingBundlerImpl;
|
|
10153
10153
|
module.exports.BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin;
|
|
10154
10154
|
module.exports.BindingChunkingContext = __napiModule.exports.BindingChunkingContext;
|
|
10155
|
-
module.exports.BindingClientHmrUpdate = __napiModule.exports.BindingClientHmrUpdate;
|
|
10156
10155
|
module.exports.BindingDevEngine = __napiModule.exports.BindingDevEngine;
|
|
10157
|
-
module.exports.BindingHmrOutput = __napiModule.exports.BindingHmrOutput;
|
|
10158
10156
|
module.exports.BindingMagicString = __napiModule.exports.BindingMagicString;
|
|
10159
10157
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo;
|
|
10160
10158
|
module.exports.BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions;
|
|
@@ -10181,6 +10179,7 @@ var require_rolldown_binding_wasi = /* @__PURE__ */ __commonJS({ "src/rolldown-b
|
|
|
10181
10179
|
module.exports.BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects;
|
|
10182
10180
|
module.exports.BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects;
|
|
10183
10181
|
module.exports.BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy;
|
|
10182
|
+
module.exports.createTokioRuntime = __napiModule.exports.createTokioRuntime;
|
|
10184
10183
|
module.exports.FilterTokenKind = __napiModule.exports.FilterTokenKind;
|
|
10185
10184
|
module.exports.initTraceSubscriber = __napiModule.exports.initTraceSubscriber;
|
|
10186
10185
|
module.exports.registerPlugins = __napiModule.exports.registerPlugins;
|
|
@@ -10270,7 +10269,7 @@ function requireNative() {
|
|
|
10270
10269
|
try {
|
|
10271
10270
|
const binding = __require("@rolldown/binding-android-arm64");
|
|
10272
10271
|
const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
|
|
10273
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10272
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10274
10273
|
return binding;
|
|
10275
10274
|
} catch (e) {
|
|
10276
10275
|
loadErrors.push(e);
|
|
@@ -10284,7 +10283,7 @@ function requireNative() {
|
|
|
10284
10283
|
try {
|
|
10285
10284
|
const binding = __require("@rolldown/binding-android-arm-eabi");
|
|
10286
10285
|
const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
|
|
10287
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10286
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10288
10287
|
return binding;
|
|
10289
10288
|
} catch (e) {
|
|
10290
10289
|
loadErrors.push(e);
|
|
@@ -10299,7 +10298,7 @@ function requireNative() {
|
|
|
10299
10298
|
try {
|
|
10300
10299
|
const binding = __require("@rolldown/binding-win32-x64-gnu");
|
|
10301
10300
|
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
|
|
10302
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10301
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10303
10302
|
return binding;
|
|
10304
10303
|
} catch (e) {
|
|
10305
10304
|
loadErrors.push(e);
|
|
@@ -10313,7 +10312,7 @@ function requireNative() {
|
|
|
10313
10312
|
try {
|
|
10314
10313
|
const binding = __require("@rolldown/binding-win32-x64-msvc");
|
|
10315
10314
|
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
|
|
10316
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10315
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10317
10316
|
return binding;
|
|
10318
10317
|
} catch (e) {
|
|
10319
10318
|
loadErrors.push(e);
|
|
@@ -10328,7 +10327,7 @@ function requireNative() {
|
|
|
10328
10327
|
try {
|
|
10329
10328
|
const binding = __require("@rolldown/binding-win32-ia32-msvc");
|
|
10330
10329
|
const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
|
|
10331
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10330
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10332
10331
|
return binding;
|
|
10333
10332
|
} catch (e) {
|
|
10334
10333
|
loadErrors.push(e);
|
|
@@ -10342,7 +10341,7 @@ function requireNative() {
|
|
|
10342
10341
|
try {
|
|
10343
10342
|
const binding = __require("@rolldown/binding-win32-arm64-msvc");
|
|
10344
10343
|
const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
|
|
10345
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10344
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10346
10345
|
return binding;
|
|
10347
10346
|
} catch (e) {
|
|
10348
10347
|
loadErrors.push(e);
|
|
@@ -10357,7 +10356,7 @@ function requireNative() {
|
|
|
10357
10356
|
try {
|
|
10358
10357
|
const binding = __require("@rolldown/binding-darwin-universal");
|
|
10359
10358
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
|
|
10360
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10359
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10361
10360
|
return binding;
|
|
10362
10361
|
} catch (e) {
|
|
10363
10362
|
loadErrors.push(e);
|
|
@@ -10371,7 +10370,7 @@ function requireNative() {
|
|
|
10371
10370
|
try {
|
|
10372
10371
|
const binding = __require("@rolldown/binding-darwin-x64");
|
|
10373
10372
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
|
|
10374
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10373
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10375
10374
|
return binding;
|
|
10376
10375
|
} catch (e) {
|
|
10377
10376
|
loadErrors.push(e);
|
|
@@ -10385,7 +10384,7 @@ function requireNative() {
|
|
|
10385
10384
|
try {
|
|
10386
10385
|
const binding = __require("@rolldown/binding-darwin-arm64");
|
|
10387
10386
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
|
|
10388
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10387
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10389
10388
|
return binding;
|
|
10390
10389
|
} catch (e) {
|
|
10391
10390
|
loadErrors.push(e);
|
|
@@ -10400,7 +10399,7 @@ function requireNative() {
|
|
|
10400
10399
|
try {
|
|
10401
10400
|
const binding = __require("@rolldown/binding-freebsd-x64");
|
|
10402
10401
|
const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
|
|
10403
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10402
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10404
10403
|
return binding;
|
|
10405
10404
|
} catch (e) {
|
|
10406
10405
|
loadErrors.push(e);
|
|
@@ -10414,7 +10413,7 @@ function requireNative() {
|
|
|
10414
10413
|
try {
|
|
10415
10414
|
const binding = __require("@rolldown/binding-freebsd-arm64");
|
|
10416
10415
|
const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
|
|
10417
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10416
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10418
10417
|
return binding;
|
|
10419
10418
|
} catch (e) {
|
|
10420
10419
|
loadErrors.push(e);
|
|
@@ -10429,7 +10428,7 @@ function requireNative() {
|
|
|
10429
10428
|
try {
|
|
10430
10429
|
const binding = __require("@rolldown/binding-linux-x64-musl");
|
|
10431
10430
|
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
|
|
10432
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10431
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10433
10432
|
return binding;
|
|
10434
10433
|
} catch (e) {
|
|
10435
10434
|
loadErrors.push(e);
|
|
@@ -10443,7 +10442,7 @@ function requireNative() {
|
|
|
10443
10442
|
try {
|
|
10444
10443
|
const binding = __require("@rolldown/binding-linux-x64-gnu");
|
|
10445
10444
|
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
|
|
10446
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10445
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10447
10446
|
return binding;
|
|
10448
10447
|
} catch (e) {
|
|
10449
10448
|
loadErrors.push(e);
|
|
@@ -10458,7 +10457,7 @@ function requireNative() {
|
|
|
10458
10457
|
try {
|
|
10459
10458
|
const binding = __require("@rolldown/binding-linux-arm64-musl");
|
|
10460
10459
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
|
|
10461
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10460
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10462
10461
|
return binding;
|
|
10463
10462
|
} catch (e) {
|
|
10464
10463
|
loadErrors.push(e);
|
|
@@ -10472,7 +10471,7 @@ function requireNative() {
|
|
|
10472
10471
|
try {
|
|
10473
10472
|
const binding = __require("@rolldown/binding-linux-arm64-gnu");
|
|
10474
10473
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
|
|
10475
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10474
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10476
10475
|
return binding;
|
|
10477
10476
|
} catch (e) {
|
|
10478
10477
|
loadErrors.push(e);
|
|
@@ -10487,7 +10486,7 @@ function requireNative() {
|
|
|
10487
10486
|
try {
|
|
10488
10487
|
const binding = __require("@rolldown/binding-linux-arm-musleabihf");
|
|
10489
10488
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
|
|
10490
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10489
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10491
10490
|
return binding;
|
|
10492
10491
|
} catch (e) {
|
|
10493
10492
|
loadErrors.push(e);
|
|
@@ -10501,7 +10500,7 @@ function requireNative() {
|
|
|
10501
10500
|
try {
|
|
10502
10501
|
const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
|
|
10503
10502
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
|
|
10504
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10503
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10505
10504
|
return binding;
|
|
10506
10505
|
} catch (e) {
|
|
10507
10506
|
loadErrors.push(e);
|
|
@@ -10516,7 +10515,7 @@ function requireNative() {
|
|
|
10516
10515
|
try {
|
|
10517
10516
|
const binding = __require("@rolldown/binding-linux-loong64-musl");
|
|
10518
10517
|
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
|
|
10519
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10518
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10520
10519
|
return binding;
|
|
10521
10520
|
} catch (e) {
|
|
10522
10521
|
loadErrors.push(e);
|
|
@@ -10530,7 +10529,7 @@ function requireNative() {
|
|
|
10530
10529
|
try {
|
|
10531
10530
|
const binding = __require("@rolldown/binding-linux-loong64-gnu");
|
|
10532
10531
|
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
|
|
10533
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10532
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10534
10533
|
return binding;
|
|
10535
10534
|
} catch (e) {
|
|
10536
10535
|
loadErrors.push(e);
|
|
@@ -10545,7 +10544,7 @@ function requireNative() {
|
|
|
10545
10544
|
try {
|
|
10546
10545
|
const binding = __require("@rolldown/binding-linux-riscv64-musl");
|
|
10547
10546
|
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
|
|
10548
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10547
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10549
10548
|
return binding;
|
|
10550
10549
|
} catch (e) {
|
|
10551
10550
|
loadErrors.push(e);
|
|
@@ -10559,7 +10558,7 @@ function requireNative() {
|
|
|
10559
10558
|
try {
|
|
10560
10559
|
const binding = __require("@rolldown/binding-linux-riscv64-gnu");
|
|
10561
10560
|
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
|
|
10562
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10561
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10563
10562
|
return binding;
|
|
10564
10563
|
} catch (e) {
|
|
10565
10564
|
loadErrors.push(e);
|
|
@@ -10574,7 +10573,7 @@ function requireNative() {
|
|
|
10574
10573
|
try {
|
|
10575
10574
|
const binding = __require("@rolldown/binding-linux-ppc64-gnu");
|
|
10576
10575
|
const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
|
|
10577
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10576
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10578
10577
|
return binding;
|
|
10579
10578
|
} catch (e) {
|
|
10580
10579
|
loadErrors.push(e);
|
|
@@ -10588,7 +10587,7 @@ function requireNative() {
|
|
|
10588
10587
|
try {
|
|
10589
10588
|
const binding = __require("@rolldown/binding-linux-s390x-gnu");
|
|
10590
10589
|
const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
|
|
10591
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10590
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10592
10591
|
return binding;
|
|
10593
10592
|
} catch (e) {
|
|
10594
10593
|
loadErrors.push(e);
|
|
@@ -10603,7 +10602,7 @@ function requireNative() {
|
|
|
10603
10602
|
try {
|
|
10604
10603
|
const binding = __require("@rolldown/binding-openharmony-arm64");
|
|
10605
10604
|
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
|
|
10606
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10605
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10607
10606
|
return binding;
|
|
10608
10607
|
} catch (e) {
|
|
10609
10608
|
loadErrors.push(e);
|
|
@@ -10617,7 +10616,7 @@ function requireNative() {
|
|
|
10617
10616
|
try {
|
|
10618
10617
|
const binding = __require("@rolldown/binding-openharmony-x64");
|
|
10619
10618
|
const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
|
|
10620
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10619
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10621
10620
|
return binding;
|
|
10622
10621
|
} catch (e) {
|
|
10623
10622
|
loadErrors.push(e);
|
|
@@ -10631,7 +10630,7 @@ function requireNative() {
|
|
|
10631
10630
|
try {
|
|
10632
10631
|
const binding = __require("@rolldown/binding-openharmony-arm");
|
|
10633
10632
|
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
|
|
10634
|
-
if (bindingPackageVersion !== "1.0.0-beta.
|
|
10633
|
+
if (bindingPackageVersion !== "1.0.0-beta.43" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-beta.43 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
10635
10634
|
return binding;
|
|
10636
10635
|
} catch (e) {
|
|
10637
10636
|
loadErrors.push(e);
|
|
@@ -10676,7 +10675,7 @@ if (!nativeBinding) {
|
|
|
10676
10675
|
}) });
|
|
10677
10676
|
throw new Error(`Failed to load native binding`);
|
|
10678
10677
|
}
|
|
10679
|
-
const { minify, Severity, ParseResult, ExportExportNameKind, ExportImportNameKind, ExportLocalNameKind, ImportNameKind, parseAsync, parseSync, rawTransferSupported, ResolverFactory, EnforceExtension, ModuleType, sync, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform, transformAsync, BindingBundleEndEventData, BindingBundleErrorEventData, BindingBundler, BindingBundlerImpl, BindingCallableBuiltinPlugin, BindingChunkingContext,
|
|
10678
|
+
const { minify, Severity, ParseResult, ExportExportNameKind, ExportImportNameKind, ExportLocalNameKind, ImportNameKind, parseAsync, parseSync, rawTransferSupported, ResolverFactory, EnforceExtension, ModuleType, sync, HelperMode, isolatedDeclaration, moduleRunnerTransform, transform, transformAsync, BindingBundleEndEventData, BindingBundleErrorEventData, BindingBundler, BindingBundlerImpl, BindingCallableBuiltinPlugin, BindingChunkingContext, BindingDevEngine, BindingMagicString, BindingModuleInfo, BindingNormalizedOptions, BindingOutputAsset, BindingOutputChunk, BindingOutputs, BindingPluginContext, BindingRenderedChunk, BindingRenderedChunkMeta, BindingRenderedModule, BindingTransformPluginContext, BindingWatcher, BindingWatcherChangeData, BindingWatcherEvent, ParallelJsPluginRegistry, ScheduledBuild, TraceSubscriberGuard, BindingAttachDebugInfo, BindingBuiltinPluginName, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingRebuildStrategy, createTokioRuntime, FilterTokenKind, initTraceSubscriber, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime } = nativeBinding;
|
|
10680
10679
|
|
|
10681
10680
|
//#endregion
|
|
10682
10681
|
//#region src/utils/code-frame.ts
|
|
@@ -10942,4 +10941,4 @@ async function parseAstAsync(sourceText, options, filename) {
|
|
|
10942
10941
|
}
|
|
10943
10942
|
|
|
10944
10943
|
//#endregion
|
|
10945
|
-
export { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy,
|
|
10944
|
+
export { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingDevEngine, BindingJsx, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingRebuildStrategy, BindingWatcher, ParallelJsPluginRegistry, ResolverFactory, augmentCodeLocation, createTokioRuntime, error, initTraceSubscriber, isolatedDeclaration, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, moduleRunnerTransform, parseAst, parseAstAsync, registerPlugins, shutdownAsyncRuntime, startAsyncRuntime, transform };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, initTraceSubscriber, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-
|
|
1
|
+
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, initTraceSubscriber, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-DkUtf7vl.mjs";
|
|
2
2
|
import { arraify, noop, unimplemented, unreachable, unsupported } from "./misc-CQeo-AFx.mjs";
|
|
3
3
|
import { Worker, isMainThread } from "node:worker_threads";
|
|
4
4
|
import path from "node:path";
|
|
@@ -218,7 +218,7 @@ if (isMainThread) {
|
|
|
218
218
|
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region package.json
|
|
221
|
-
var version = "1.0.0-beta.
|
|
221
|
+
var version = "1.0.0-beta.43";
|
|
222
222
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
223
223
|
|
|
224
224
|
//#endregion
|
|
@@ -1879,7 +1879,8 @@ const InputOptionsSchema = strictObject({
|
|
|
1879
1879
|
chunkImportMap: optional(union([boolean(), object({
|
|
1880
1880
|
baseUrl: optional(string()),
|
|
1881
1881
|
fileName: optional(string())
|
|
1882
|
-
})]))
|
|
1882
|
+
})])),
|
|
1883
|
+
nativeMagicString: optional(boolean())
|
|
1883
1884
|
})),
|
|
1884
1885
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
1885
1886
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
@@ -1946,6 +1947,7 @@ const ChunkFileNamesSchema = union([string(), pipe(function_(), args(tuple([cust
|
|
|
1946
1947
|
const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([custom(() => true)])), returns(string()))]);
|
|
1947
1948
|
const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
|
|
1948
1949
|
const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
|
|
1950
|
+
const PathsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
|
|
1949
1951
|
const AdvancedChunksSchema = strictObject({
|
|
1950
1952
|
includeDependenciesRecursively: optional(boolean()),
|
|
1951
1953
|
minSize: optional(number()),
|
|
@@ -2020,6 +2022,7 @@ const OutputOptionsSchema = strictObject({
|
|
|
2020
2022
|
])), description("Minify the bundled file")),
|
|
2021
2023
|
name: pipe(optional(string()), description("Name for UMD / IIFE format outputs")),
|
|
2022
2024
|
globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
|
|
2025
|
+
paths: pipe(optional(union([record(string(), string()), PathsFunctionSchema])), description("Maps external module IDs to paths")),
|
|
2023
2026
|
generatedCode: pipe(optional(partial(GeneratedCodeOptionsSchema)), description("Generated code options")),
|
|
2024
2027
|
externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
|
|
2025
2028
|
inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
|
|
@@ -2144,6 +2147,10 @@ function unwrapBindingResult(container) {
|
|
|
2144
2147
|
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) throw aggregateBindingErrorsIntoJsError(container.errors);
|
|
2145
2148
|
return container;
|
|
2146
2149
|
}
|
|
2150
|
+
function normalizeBindingResult(container) {
|
|
2151
|
+
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) return aggregateBindingErrorsIntoJsError(container.errors);
|
|
2152
|
+
return container;
|
|
2153
|
+
}
|
|
2147
2154
|
function normalizeBindingError(e$1) {
|
|
2148
2155
|
return e$1.type === "JsError" ? e$1.field0 : Object.assign(/* @__PURE__ */ new Error(), {
|
|
2149
2156
|
kind: e$1.field0.kind,
|
|
@@ -2468,7 +2475,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2468
2475
|
this.data.updateModuleOption(id, rawOptions);
|
|
2469
2476
|
let loadPromise = this.data.loadModulePromiseMap.get(id);
|
|
2470
2477
|
if (!loadPromise) {
|
|
2471
|
-
loadPromise = this.context.load(id, options.moduleSideEffects ?? void 0).catch(() => {
|
|
2478
|
+
loadPromise = this.context.load(id, options.moduleSideEffects ?? void 0, options.packageJsonPath ?? void 0).catch(() => {
|
|
2472
2479
|
this.data.loadModulePromiseMap.delete(id);
|
|
2473
2480
|
});
|
|
2474
2481
|
this.data.loadModulePromiseMap.set(id, loadPromise);
|
|
@@ -2570,6 +2577,9 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
2570
2577
|
addWatchFile(id) {
|
|
2571
2578
|
this.inner.addWatchFile(id);
|
|
2572
2579
|
}
|
|
2580
|
+
sendMagicString(s) {
|
|
2581
|
+
this.inner.sendMagicString(s);
|
|
2582
|
+
}
|
|
2573
2583
|
};
|
|
2574
2584
|
|
|
2575
2585
|
//#endregion
|
|
@@ -2669,7 +2679,29 @@ function bindingifyTransform(args$1) {
|
|
|
2669
2679
|
const { handler, meta, options } = normalizeHook(hook);
|
|
2670
2680
|
return {
|
|
2671
2681
|
plugin: async (ctx, code, id, meta$1) => {
|
|
2672
|
-
|
|
2682
|
+
Object.defineProperties(meta$1, {
|
|
2683
|
+
magicString: { get() {
|
|
2684
|
+
return new BindingMagicString(code);
|
|
2685
|
+
} },
|
|
2686
|
+
ast: { get() {
|
|
2687
|
+
let lang = "js";
|
|
2688
|
+
switch (meta$1.moduleType) {
|
|
2689
|
+
case "js":
|
|
2690
|
+
case "jsx":
|
|
2691
|
+
case "ts":
|
|
2692
|
+
case "tsx":
|
|
2693
|
+
lang = meta$1.moduleType;
|
|
2694
|
+
break;
|
|
2695
|
+
default: break;
|
|
2696
|
+
}
|
|
2697
|
+
return parseAst(code, {
|
|
2698
|
+
astType: meta$1.moduleType.includes("ts") ? "ts" : "js",
|
|
2699
|
+
lang
|
|
2700
|
+
});
|
|
2701
|
+
} }
|
|
2702
|
+
});
|
|
2703
|
+
const transformCtx = new TransformPluginContextImpl(args$1.outputOptions, ctx.inner(), args$1.plugin, args$1.pluginContextData, ctx, id, code, args$1.onLog, args$1.logLevel, args$1.watchMode);
|
|
2704
|
+
const ret = await handler.call(transformCtx, code, id, meta$1);
|
|
2673
2705
|
if (ret == null) return;
|
|
2674
2706
|
if (typeof ret === "string") return { code: ret };
|
|
2675
2707
|
let moduleOption = args$1.pluginContextData.updateModuleOption(id, {
|
|
@@ -2677,9 +2709,18 @@ function bindingifyTransform(args$1) {
|
|
|
2677
2709
|
moduleSideEffects: ret.moduleSideEffects ?? null,
|
|
2678
2710
|
invalidate: false
|
|
2679
2711
|
});
|
|
2712
|
+
let normalizedCode = void 0;
|
|
2713
|
+
let map = ret.map;
|
|
2714
|
+
if (typeof ret.code === "string") normalizedCode = ret.code;
|
|
2715
|
+
else if (ret.code instanceof BindingMagicString) {
|
|
2716
|
+
let magicString = ret.code;
|
|
2717
|
+
normalizedCode = magicString.toString();
|
|
2718
|
+
let fallbackSourcemap = ctx.sendMagicString(magicString);
|
|
2719
|
+
if (fallbackSourcemap != void 0) map = fallbackSourcemap;
|
|
2720
|
+
}
|
|
2680
2721
|
return {
|
|
2681
|
-
code:
|
|
2682
|
-
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code,
|
|
2722
|
+
code: normalizedCode,
|
|
2723
|
+
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code, map)),
|
|
2683
2724
|
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
|
|
2684
2725
|
moduleType: ret.moduleType
|
|
2685
2726
|
};
|
|
@@ -3407,6 +3448,9 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3407
3448
|
get globals() {
|
|
3408
3449
|
return this.inner.globals || this.outputOptions.globals;
|
|
3409
3450
|
}
|
|
3451
|
+
get paths() {
|
|
3452
|
+
return this.outputOptions.paths;
|
|
3453
|
+
}
|
|
3410
3454
|
get hashCharacters() {
|
|
3411
3455
|
return this.inner.hashCharacters;
|
|
3412
3456
|
}
|
|
@@ -3661,7 +3705,8 @@ function bindingifyExperimental(experimental) {
|
|
|
3661
3705
|
chunkModulesOrder,
|
|
3662
3706
|
chunkImportMap: experimental?.chunkImportMap,
|
|
3663
3707
|
onDemandWrapping: experimental?.onDemandWrapping,
|
|
3664
|
-
incrementalBuild: experimental?.incrementalBuild
|
|
3708
|
+
incrementalBuild: experimental?.incrementalBuild,
|
|
3709
|
+
nativeMagicString: experimental?.nativeMagicString
|
|
3665
3710
|
};
|
|
3666
3711
|
}
|
|
3667
3712
|
function bindingifyResolve(resolve) {
|
|
@@ -3850,7 +3895,7 @@ var ChunkingContextImpl = class {
|
|
|
3850
3895
|
//#endregion
|
|
3851
3896
|
//#region src/utils/bindingify-output-options.ts
|
|
3852
3897
|
function bindingifyOutputOptions(outputOptions) {
|
|
3853
|
-
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3898
|
+
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3854
3899
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3855
3900
|
return {
|
|
3856
3901
|
dir,
|
|
@@ -3869,6 +3914,7 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3869
3914
|
outro: bindingifyAddon(outro),
|
|
3870
3915
|
extend: outputOptions.extend,
|
|
3871
3916
|
globals,
|
|
3917
|
+
paths,
|
|
3872
3918
|
generatedCode,
|
|
3873
3919
|
esModule,
|
|
3874
3920
|
name,
|
|
@@ -4269,4 +4315,4 @@ function defineConfig(config) {
|
|
|
4269
4315
|
const VERSION = version;
|
|
4270
4316
|
|
|
4271
4317
|
//#endregion
|
|
4272
|
-
export { BuiltinPlugin, PluginContextData, PluginDriver, RolldownBuild, VERSION, bindingifyPlugin, build, createBundlerOptions, defineConfig, description$1 as description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, makeBuiltinPluginCallable, normalizedStringOrRegex, onExit, rolldown, validateCliOptions, version, watch };
|
|
4318
|
+
export { BuiltinPlugin, PluginContextData, PluginDriver, RolldownBuild, VERSION, bindingifyPlugin, build, createBundlerOptions, defineConfig, description$1 as description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, makeBuiltinPluginCallable, normalizeBindingResult, normalizedStringOrRegex, onExit, rolldown, validateCliOptions, version, watch };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.43",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://rolldown.rs/",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@oxc-project/types": "=0.94.0",
|
|
79
79
|
"ansis": "=4.2.0",
|
|
80
|
-
"@rolldown/pluginutils": "1.0.0-beta.
|
|
80
|
+
"@rolldown/pluginutils": "1.0.0-beta.43"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@napi-rs/cli": "^3.2.0",
|
|
@@ -99,26 +99,26 @@
|
|
|
99
99
|
"typedoc": "^0.28.0",
|
|
100
100
|
"typescript": "^5.8.3",
|
|
101
101
|
"valibot": "1.1.0",
|
|
102
|
-
"rolldown": "1.0.0-beta.
|
|
102
|
+
"rolldown": "1.0.0-beta.43"
|
|
103
103
|
},
|
|
104
104
|
"engines": {
|
|
105
105
|
"node": "^20.19.0 || >=22.12.0"
|
|
106
106
|
},
|
|
107
107
|
"optionalDependencies": {
|
|
108
|
-
"@rolldown/binding-darwin-x64": "1.0.0-beta.
|
|
109
|
-
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.
|
|
110
|
-
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.
|
|
111
|
-
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.
|
|
112
|
-
"@rolldown/binding-freebsd-x64": "1.0.0-beta.
|
|
113
|
-
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.
|
|
114
|
-
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.
|
|
115
|
-
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.
|
|
116
|
-
"@rolldown/binding-darwin-arm64": "1.0.0-beta.
|
|
117
|
-
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.
|
|
118
|
-
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.
|
|
119
|
-
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.
|
|
120
|
-
"@rolldown/binding-android-arm64": "1.0.0-beta.
|
|
121
|
-
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.
|
|
108
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.43",
|
|
109
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.43",
|
|
110
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.43",
|
|
111
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.43",
|
|
112
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.43",
|
|
113
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.43",
|
|
114
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.43",
|
|
115
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.43",
|
|
116
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.43",
|
|
117
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.43",
|
|
118
|
+
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.43",
|
|
119
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.43",
|
|
120
|
+
"@rolldown/binding-android-arm64": "1.0.0-beta.43",
|
|
121
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.43"
|
|
122
122
|
},
|
|
123
123
|
"scripts": {
|
|
124
124
|
"# Scrips for binding #": "_",
|