@rolldown/browser 1.0.0-beta.38 → 1.0.0-beta.40
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 +4 -4
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.browser.mjs +5 -4
- package/dist/experimental-index.d.mts +3 -3
- package/dist/experimental-index.mjs +7 -6
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.browser.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.mjs +3 -3
- 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/rolldown-binding.wasi-browser.js +2 -0
- package/dist/rolldown-binding.wasi.cjs +2 -0
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-D6vpD1fz.d.mts → binding-BVXbXhPv.d.mts} +7 -5
- package/dist/shared/{define-config-D-OneP9q.d.mts → define-config-D9LkukIg.d.mts} +34 -3
- package/dist/shared/{load-config-BGatf3rT.mjs → load-config-CU4Yss-9.mjs} +1 -1
- package/dist/shared/{parse-ast-index-CR2E9ZQS.mjs → parse-ast-index-DuyJNdzo.mjs} +2 -2
- package/dist/shared/{src-E1KQKxjT.mjs → src-BfUPNTHw.mjs} +139 -154
- package/dist/{src-DE1CLQYz.js → src-ChN10Pih.js} +138 -153
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ansis_default, description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, onExit, rolldown, validateCliOptions, version, watch } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { ansis_default, description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, onExit, rolldown, validateCliOptions, version, watch } from "./shared/src-BfUPNTHw.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-DuyJNdzo.mjs";
|
|
3
3
|
import { arraify } from "./shared/dist-CHTC3-kR.mjs";
|
|
4
4
|
import { logger } from "./shared/logger-CiCY7ucm.mjs";
|
|
5
|
-
import { loadConfig } from "./shared/load-config-
|
|
5
|
+
import { loadConfig } from "./shared/load-config-CU4Yss-9.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { parseArgs } from "node:util";
|
|
8
8
|
import process$1 from "node:process";
|
|
@@ -241,7 +241,7 @@ function getClearScreenFunction(options$1) {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
//#endregion
|
|
244
|
-
//#region \0@oxc-project+runtime@0.
|
|
244
|
+
//#region \0@oxc-project+runtime@0.92.0/helpers/usingCtx.js
|
|
245
245
|
function _usingCtx() {
|
|
246
246
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {
|
|
247
247
|
var n$1 = Error();
|
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-BVXbXhPv.mjs";
|
|
2
|
+
import { ConfigExport, defineConfig } from "./shared/define-config-D9LkukIg.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 { defineConfig, version } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { defineConfig, version } from "./shared/src-BfUPNTHw.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-DuyJNdzo.mjs";
|
|
3
3
|
import "./shared/dist-CHTC3-kR.mjs";
|
|
4
|
-
import { loadConfig } from "./shared/load-config-
|
|
4
|
+
import { loadConfig } from "./shared/load-config-CU4Yss-9.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/config.ts
|
|
7
7
|
const VERSION = version;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./src-
|
|
1
|
+
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./src-ChN10Pih.js";
|
|
2
2
|
import { BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
|
|
3
3
|
|
|
4
4
|
//#region src/api/dev/dev-engine.ts
|
|
@@ -37,8 +37,8 @@ var DevEngine = class DevEngine {
|
|
|
37
37
|
this.#cachedBuildFinishPromise = promise;
|
|
38
38
|
return promise;
|
|
39
39
|
}
|
|
40
|
-
async
|
|
41
|
-
await this.#inner.
|
|
40
|
+
async ensureLatestBuildOutput() {
|
|
41
|
+
await this.#inner.ensureLatestBuildOutput();
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Returns true if a new build is scheduled.
|
|
@@ -141,7 +141,8 @@ function reactRefreshWrapperPlugin(config) {
|
|
|
141
141
|
config.include = normalizedStringOrRegex(config.include);
|
|
142
142
|
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
const builtinPlugin = new BuiltinPlugin("builtin:react-refresh-wrapper", config);
|
|
145
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHmrUpdate, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, 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, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHmrUpdate, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-BVXbXhPv.mjs";
|
|
2
|
+
import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-D9LkukIg.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/dev/dev-options.d.ts
|
|
5
5
|
interface DevWatchOptions {
|
|
@@ -54,7 +54,7 @@ declare class DevEngine {
|
|
|
54
54
|
private constructor();
|
|
55
55
|
run(): Promise<void>;
|
|
56
56
|
ensureCurrentBuildFinish(): Promise<void>;
|
|
57
|
-
|
|
57
|
+
ensureLatestBuildOutput(): Promise<void>;
|
|
58
58
|
/**
|
|
59
59
|
* Returns true if a new build is scheduled.
|
|
60
60
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./shared/src-BfUPNTHw.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-DuyJNdzo.mjs";
|
|
3
3
|
import "./shared/dist-CHTC3-kR.mjs";
|
|
4
4
|
import { logger } from "./shared/logger-CiCY7ucm.mjs";
|
|
5
|
-
import { BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi
|
|
5
|
+
import { BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
|
|
8
8
|
//#region src/api/dev/dev-engine.ts
|
|
@@ -41,8 +41,8 @@ var DevEngine = class DevEngine {
|
|
|
41
41
|
this.#cachedBuildFinishPromise = promise;
|
|
42
42
|
return promise;
|
|
43
43
|
}
|
|
44
|
-
async
|
|
45
|
-
await this.#inner.
|
|
44
|
+
async ensureLatestBuildOutput() {
|
|
45
|
+
await this.#inner.ensureLatestBuildOutput();
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Returns true if a new build is scheduled.
|
|
@@ -150,7 +150,8 @@ function reactRefreshWrapperPlugin(config) {
|
|
|
150
150
|
config.include = normalizedStringOrRegex(config.include);
|
|
151
151
|
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
const builtinPlugin = new BuiltinPlugin("builtin:react-refresh-wrapper", config);
|
|
154
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
154
155
|
}
|
|
155
156
|
|
|
156
157
|
//#endregion
|
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-BVXbXhPv.mjs";
|
|
2
|
+
import { withFilter } from "./shared/define-config-D9LkukIg.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.browser.mjs
CHANGED
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, 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-
|
|
1
|
+
import { PreRenderedChunk } from "./shared/binding-BVXbXhPv.mjs";
|
|
2
|
+
import { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, 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-D9LkukIg.mjs";
|
|
3
3
|
export { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, 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 { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-BfUPNTHw.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-DuyJNdzo.mjs";
|
|
3
3
|
import "./shared/dist-CHTC3-kR.mjs";
|
|
4
4
|
|
|
5
5
|
export { VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PluginContextData, bindingifyPlugin } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { PluginContextData, bindingifyPlugin } from "./shared/src-BfUPNTHw.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-DuyJNdzo.mjs";
|
|
3
3
|
import "./shared/dist-CHTC3-kR.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
|
-
import { registerPlugins } from "./rolldown-binding.wasi
|
|
5
|
+
import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
|
6
6
|
|
|
7
7
|
//#region src/parallel-plugin-worker.ts
|
|
8
8
|
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { MaybePromise, Plugin } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-BVXbXhPv.mjs";
|
|
2
|
+
import { MaybePromise, Plugin } from "./shared/define-config-D9LkukIg.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
|
@@ -81,6 +81,7 @@ export const HelperMode = __napiModule.exports.HelperMode
|
|
|
81
81
|
export const isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
82
82
|
export const moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
83
83
|
export const transform = __napiModule.exports.transform
|
|
84
|
+
export const transformAsync = __napiModule.exports.transformAsync
|
|
84
85
|
export const BindingBundleEndEventData = __napiModule.exports.BindingBundleEndEventData
|
|
85
86
|
export const BindingBundleErrorEventData = __napiModule.exports.BindingBundleErrorEventData
|
|
86
87
|
export const BindingBundler = __napiModule.exports.BindingBundler
|
|
@@ -89,6 +90,7 @@ export const BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallable
|
|
|
89
90
|
export const BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
90
91
|
export const BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
91
92
|
export const BindingHmrOutput = __napiModule.exports.BindingHmrOutput
|
|
93
|
+
export const BindingMagicString = __napiModule.exports.BindingMagicString
|
|
92
94
|
export const BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
93
95
|
export const BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
94
96
|
export const BindingOutputAsset = __napiModule.exports.BindingOutputAsset
|
|
@@ -126,6 +126,7 @@ module.exports.HelperMode = __napiModule.exports.HelperMode
|
|
|
126
126
|
module.exports.isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
127
127
|
module.exports.moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
128
128
|
module.exports.transform = __napiModule.exports.transform
|
|
129
|
+
module.exports.transformAsync = __napiModule.exports.transformAsync
|
|
129
130
|
module.exports.BindingBundleEndEventData = __napiModule.exports.BindingBundleEndEventData
|
|
130
131
|
module.exports.BindingBundleErrorEventData = __napiModule.exports.BindingBundleErrorEventData
|
|
131
132
|
module.exports.BindingBundler = __napiModule.exports.BindingBundler
|
|
@@ -134,6 +135,7 @@ module.exports.BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallab
|
|
|
134
135
|
module.exports.BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
135
136
|
module.exports.BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
136
137
|
module.exports.BindingHmrOutput = __napiModule.exports.BindingHmrOutput
|
|
138
|
+
module.exports.BindingMagicString = __napiModule.exports.BindingMagicString
|
|
137
139
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
138
140
|
module.exports.BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
139
141
|
module.exports.BindingOutputAsset = __napiModule.exports.BindingOutputAsset
|
|
Binary file
|
|
@@ -18,14 +18,16 @@ interface CompressOptions {
|
|
|
18
18
|
*
|
|
19
19
|
* Set `esnext` to enable all target highering.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* Example:
|
|
22
22
|
*
|
|
23
|
-
* *
|
|
24
|
-
* *
|
|
23
|
+
* * `'es2015'`
|
|
24
|
+
* * `['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11']`
|
|
25
25
|
*
|
|
26
26
|
* @default 'esnext'
|
|
27
|
+
*
|
|
28
|
+
* @see [esbuild#target](https://esbuild.github.io/api/#target)
|
|
27
29
|
*/
|
|
28
|
-
target?:
|
|
30
|
+
target?: string | Array<string>;
|
|
29
31
|
/**
|
|
30
32
|
* Pass true to discard calls to `console.*`.
|
|
31
33
|
*
|
|
@@ -1321,6 +1323,7 @@ interface BindingModules {
|
|
|
1321
1323
|
keys: Array<string>;
|
|
1322
1324
|
}
|
|
1323
1325
|
interface BindingReactRefreshWrapperPluginConfig {
|
|
1326
|
+
cwd: string;
|
|
1324
1327
|
include?: Array<BindingStringOrRegex>;
|
|
1325
1328
|
exclude?: Array<BindingStringOrRegex>;
|
|
1326
1329
|
jsxImportSource: string;
|
|
@@ -1361,7 +1364,6 @@ interface BindingTransformPluginConfig {
|
|
|
1361
1364
|
jsxRefreshInclude?: Array<BindingStringOrRegex>;
|
|
1362
1365
|
jsxRefreshExclude?: Array<BindingStringOrRegex>;
|
|
1363
1366
|
isServerConsumer?: boolean;
|
|
1364
|
-
runtimeResolveBase?: string;
|
|
1365
1367
|
jsxInject?: string;
|
|
1366
1368
|
transformOptions?: TransformOptions;
|
|
1367
1369
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-
|
|
1
|
+
import { BindingBuiltinPluginName, BindingBundlerImpl, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingRenderedChunk, BindingTransformHookExtraArgs, BindingWatcherEvent, MinifyOptions as MinifyOptions$1, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-BVXbXhPv.mjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
|
|
@@ -172,7 +172,38 @@ interface OutputOptions {
|
|
|
172
172
|
sourcemap?: boolean | "inline" | "hidden";
|
|
173
173
|
sourcemapBaseUrl?: string;
|
|
174
174
|
sourcemapDebugIds?: boolean;
|
|
175
|
-
|
|
175
|
+
/**
|
|
176
|
+
* Control which source files are included in the sourcemap ignore list.
|
|
177
|
+
* Files in the ignore list are excluded from debugger stepping and error stack traces.
|
|
178
|
+
*
|
|
179
|
+
* - `false`: Include all source files in the ignore list
|
|
180
|
+
* - `true`: Include no source files in the ignore list
|
|
181
|
+
* - `string`: Files containing this string in their path will be included in the ignore list
|
|
182
|
+
* - `RegExp`: Files matching this regular expression will be included in the ignore list
|
|
183
|
+
* - `function`: Custom function `(source: string, sourcemapPath: string) => boolean` to determine if a source should be ignored
|
|
184
|
+
*
|
|
185
|
+
* :::tip Performance
|
|
186
|
+
* Using static values (`boolean`, `string`, or `RegExp`) is significantly more performant than functions.
|
|
187
|
+
* Calling JavaScript functions from Rust has extremely high overhead, so prefer static patterns when possible.
|
|
188
|
+
* :::
|
|
189
|
+
*
|
|
190
|
+
* ## Examples
|
|
191
|
+
* ```js
|
|
192
|
+
* // ✅ Preferred: Use RegExp for better performance
|
|
193
|
+
* sourcemapIgnoreList: /node_modules/
|
|
194
|
+
*
|
|
195
|
+
* // ✅ Preferred: Use string pattern for better performance
|
|
196
|
+
* sourcemapIgnoreList: "vendor"
|
|
197
|
+
*
|
|
198
|
+
* // ⚠️ Use sparingly: Function calls have high overhead
|
|
199
|
+
* sourcemapIgnoreList: (source, sourcemapPath) => {
|
|
200
|
+
* return source.includes('node_modules') || source.includes('.min.');
|
|
201
|
+
* }
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* **default**: /node_modules/
|
|
205
|
+
*/
|
|
206
|
+
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | StringOrRegExp;
|
|
176
207
|
sourcemapPathTransform?: SourcemapPathTransformOption;
|
|
177
208
|
banner?: string | AddonFunction;
|
|
178
209
|
footer?: string | AddonFunction;
|
|
@@ -584,7 +615,7 @@ interface NormalizedOutputOptions {
|
|
|
584
615
|
globals: Record<string, string> | GlobalsFunction;
|
|
585
616
|
hashCharacters: "base64" | "base36" | "hex";
|
|
586
617
|
sourcemapDebugIds: boolean;
|
|
587
|
-
sourcemapIgnoreList: SourcemapIgnoreListOption;
|
|
618
|
+
sourcemapIgnoreList: boolean | SourcemapIgnoreListOption | StringOrRegExp | undefined;
|
|
588
619
|
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
|
589
620
|
minify: false | MinifyOptions | "dce-only";
|
|
590
621
|
legalComments: "none" | "inline";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseAsync, parseSync } from "../rolldown-binding.wasi
|
|
1
|
+
import { parseAsync, parseSync } from "../rolldown-binding.wasi.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/code-frame.ts
|
|
4
4
|
function spaces(index) {
|
|
@@ -186,7 +186,7 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
//#endregion
|
|
189
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
189
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.92.0/node_modules/oxc-parser/src-js/wrap.js
|
|
190
190
|
function wrap$1(result) {
|
|
191
191
|
let program, module, comments, errors;
|
|
192
192
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-
|
|
1
|
+
import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-DuyJNdzo.mjs";
|
|
2
2
|
import { and, arraify, code, exclude, id, include, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-CHTC3-kR.mjs";
|
|
3
3
|
import { Worker, isMainThread } from "node:worker_threads";
|
|
4
|
-
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, initTraceSubscriber, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi
|
|
4
|
+
import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, BindingWatcher, ParallelJsPluginRegistry, initTraceSubscriber, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fsp from "node:fs/promises";
|
|
7
7
|
import os from "node:os";
|
|
@@ -243,7 +243,7 @@ if (isMainThread) {
|
|
|
243
243
|
|
|
244
244
|
//#endregion
|
|
245
245
|
//#region package.json
|
|
246
|
-
var version = "1.0.0-beta.
|
|
246
|
+
var version = "1.0.0-beta.40";
|
|
247
247
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
248
248
|
|
|
249
249
|
//#endregion
|
|
@@ -2114,7 +2114,11 @@ const OutputOptionsSchema = strictObject({
|
|
|
2114
2114
|
])), description(`Generate sourcemap (\`-s inline\` for inline, or ${ansis_default.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
|
|
2115
2115
|
sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
|
|
2116
2116
|
sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
|
|
2117
|
-
sourcemapIgnoreList: optional(union([
|
|
2117
|
+
sourcemapIgnoreList: optional(union([
|
|
2118
|
+
boolean(),
|
|
2119
|
+
custom(() => true),
|
|
2120
|
+
StringOrRegExpSchema
|
|
2121
|
+
])),
|
|
2118
2122
|
sourcemapPathTransform: optional(custom(() => true)),
|
|
2119
2123
|
banner: optional(union([string(), AddonFunctionSchema])),
|
|
2120
2124
|
footer: optional(union([string(), AddonFunctionSchema])),
|
|
@@ -2342,7 +2346,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
|
|
|
2342
2346
|
}
|
|
2343
2347
|
|
|
2344
2348
|
//#endregion
|
|
2345
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2349
|
+
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
|
|
2346
2350
|
function e(e$2, t$3, n$2) {
|
|
2347
2351
|
let r$1 = (n$3) => e$2(n$3, ...t$3);
|
|
2348
2352
|
return n$2 === void 0 ? r$1 : Object.assign(r$1, {
|
|
@@ -2352,7 +2356,7 @@ function e(e$2, t$3, n$2) {
|
|
|
2352
2356
|
}
|
|
2353
2357
|
|
|
2354
2358
|
//#endregion
|
|
2355
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2359
|
+
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
|
|
2356
2360
|
function t(t$3, n$2, r$1) {
|
|
2357
2361
|
let i$1 = t$3.length - n$2.length;
|
|
2358
2362
|
if (i$1 === 0) return t$3(...n$2);
|
|
@@ -2361,7 +2365,7 @@ function t(t$3, n$2, r$1) {
|
|
|
2361
2365
|
}
|
|
2362
2366
|
|
|
2363
2367
|
//#endregion
|
|
2364
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2368
|
+
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/partition-DAu403JQ.js
|
|
2365
2369
|
function t$1(...t$3) {
|
|
2366
2370
|
return t(n, t$3);
|
|
2367
2371
|
}
|
|
@@ -2572,23 +2576,14 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2572
2576
|
invalidate: false
|
|
2573
2577
|
};
|
|
2574
2578
|
this.data.updateModuleOption(id$1, rawOptions);
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
data.loadModulePromiseResolveFnMap.set(id$1, resolve);
|
|
2579
|
+
let loadPromise = this.data.loadModulePromiseMap.get(id$1);
|
|
2580
|
+
if (!loadPromise) {
|
|
2581
|
+
loadPromise = this.context.load(id$1, options.moduleSideEffects ?? void 0).catch(() => {
|
|
2582
|
+
this.data.loadModulePromiseMap.delete(id$1);
|
|
2580
2583
|
});
|
|
2581
|
-
data.loadModulePromiseMap.set(id$1,
|
|
2582
|
-
try {
|
|
2583
|
-
await context.load(id$1, options.moduleSideEffects ?? void 0);
|
|
2584
|
-
} catch (e$2) {
|
|
2585
|
-
data.loadModulePromiseMap.delete(id$1);
|
|
2586
|
-
data.loadModulePromiseResolveFnMap.delete(id$1);
|
|
2587
|
-
throw e$2;
|
|
2588
|
-
}
|
|
2589
|
-
return promise$1;
|
|
2584
|
+
this.data.loadModulePromiseMap.set(id$1, loadPromise);
|
|
2590
2585
|
}
|
|
2591
|
-
await
|
|
2586
|
+
await loadPromise;
|
|
2592
2587
|
return this.data.getModuleInfo(id$1, this.context);
|
|
2593
2588
|
}
|
|
2594
2589
|
async resolve(source, importer, options) {
|
|
@@ -3453,130 +3448,6 @@ var NormalizedInputOptionsImpl = class {
|
|
|
3453
3448
|
}
|
|
3454
3449
|
};
|
|
3455
3450
|
|
|
3456
|
-
//#endregion
|
|
3457
|
-
//#region src/types/chunking-context.ts
|
|
3458
|
-
var ChunkingContextImpl = class {
|
|
3459
|
-
constructor(context) {
|
|
3460
|
-
this.context = context;
|
|
3461
|
-
}
|
|
3462
|
-
getModuleInfo(moduleId) {
|
|
3463
|
-
const bindingInfo = this.context.getModuleInfo(moduleId);
|
|
3464
|
-
if (bindingInfo) return transformModuleInfo(bindingInfo, {
|
|
3465
|
-
moduleSideEffects: null,
|
|
3466
|
-
meta: {}
|
|
3467
|
-
});
|
|
3468
|
-
return null;
|
|
3469
|
-
}
|
|
3470
|
-
};
|
|
3471
|
-
|
|
3472
|
-
//#endregion
|
|
3473
|
-
//#region src/utils/bindingify-output-options.ts
|
|
3474
|
-
function bindingifyOutputOptions(outputOptions) {
|
|
3475
|
-
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3476
|
-
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3477
|
-
return {
|
|
3478
|
-
dir,
|
|
3479
|
-
file: file == null ? void 0 : file,
|
|
3480
|
-
format: bindingifyFormat(format),
|
|
3481
|
-
exports,
|
|
3482
|
-
hashCharacters,
|
|
3483
|
-
sourcemap: bindingifySourcemap(sourcemap),
|
|
3484
|
-
sourcemapBaseUrl,
|
|
3485
|
-
sourcemapDebugIds,
|
|
3486
|
-
sourcemapIgnoreList: bindingifySourcemapIgnoreList(sourcemapIgnoreList),
|
|
3487
|
-
sourcemapPathTransform,
|
|
3488
|
-
banner: bindingifyAddon(banner),
|
|
3489
|
-
footer: bindingifyAddon(footer),
|
|
3490
|
-
intro: bindingifyAddon(intro),
|
|
3491
|
-
outro: bindingifyAddon(outro),
|
|
3492
|
-
extend: outputOptions.extend,
|
|
3493
|
-
globals,
|
|
3494
|
-
esModule,
|
|
3495
|
-
name,
|
|
3496
|
-
assetFileNames: bindingifyAssetFilenames(assetFileNames),
|
|
3497
|
-
entryFileNames,
|
|
3498
|
-
chunkFileNames,
|
|
3499
|
-
cssEntryFileNames,
|
|
3500
|
-
cssChunkFileNames,
|
|
3501
|
-
plugins: [],
|
|
3502
|
-
minify: outputOptions.minify,
|
|
3503
|
-
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
3504
|
-
inlineDynamicImports: outputOptions.inlineDynamicImports,
|
|
3505
|
-
advancedChunks,
|
|
3506
|
-
polyfillRequire: outputOptions.polyfillRequire,
|
|
3507
|
-
sanitizeFileName,
|
|
3508
|
-
preserveModules,
|
|
3509
|
-
virtualDirname,
|
|
3510
|
-
legalComments,
|
|
3511
|
-
preserveModulesRoot,
|
|
3512
|
-
topLevelVar,
|
|
3513
|
-
minifyInternalExports: outputOptions.minifyInternalExports
|
|
3514
|
-
};
|
|
3515
|
-
}
|
|
3516
|
-
function bindingifyAddon(configAddon) {
|
|
3517
|
-
return async (chunk) => {
|
|
3518
|
-
if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
|
|
3519
|
-
return configAddon || "";
|
|
3520
|
-
};
|
|
3521
|
-
}
|
|
3522
|
-
function bindingifyFormat(format) {
|
|
3523
|
-
switch (format) {
|
|
3524
|
-
case void 0:
|
|
3525
|
-
case "es":
|
|
3526
|
-
case "esm":
|
|
3527
|
-
case "module": return "es";
|
|
3528
|
-
case "cjs":
|
|
3529
|
-
case "commonjs": return "cjs";
|
|
3530
|
-
case "iife": return "iife";
|
|
3531
|
-
case "umd": return "umd";
|
|
3532
|
-
default: unimplemented(`output.format: ${format}`);
|
|
3533
|
-
}
|
|
3534
|
-
}
|
|
3535
|
-
function bindingifySourcemap(sourcemap) {
|
|
3536
|
-
switch (sourcemap) {
|
|
3537
|
-
case true: return "file";
|
|
3538
|
-
case "inline": return "inline";
|
|
3539
|
-
case false:
|
|
3540
|
-
case void 0: return;
|
|
3541
|
-
case "hidden": return "hidden";
|
|
3542
|
-
default: throw new Error(`unknown sourcemap: ${sourcemap}`);
|
|
3543
|
-
}
|
|
3544
|
-
}
|
|
3545
|
-
function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
|
|
3546
|
-
return typeof sourcemapIgnoreList === "function" ? sourcemapIgnoreList : sourcemapIgnoreList === false ? () => false : (relativeSourcePath, _sourcemapPath) => relativeSourcePath.includes("node_modules");
|
|
3547
|
-
}
|
|
3548
|
-
function bindingifyAssetFilenames(assetFileNames) {
|
|
3549
|
-
if (typeof assetFileNames === "function") return (asset) => {
|
|
3550
|
-
return assetFileNames({
|
|
3551
|
-
name: asset.name,
|
|
3552
|
-
names: asset.names,
|
|
3553
|
-
originalFileName: asset.originalFileName,
|
|
3554
|
-
originalFileNames: asset.originalFileNames,
|
|
3555
|
-
source: transformAssetSource(asset.source),
|
|
3556
|
-
type: "asset"
|
|
3557
|
-
});
|
|
3558
|
-
};
|
|
3559
|
-
return assetFileNames;
|
|
3560
|
-
}
|
|
3561
|
-
function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
|
|
3562
|
-
if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
|
|
3563
|
-
else if (manualChunks != null) advancedChunks = { groups: [{ name(moduleId, ctx) {
|
|
3564
|
-
return manualChunks(moduleId, { getModuleInfo: (id$1) => ctx.getModuleInfo(id$1) });
|
|
3565
|
-
} }] };
|
|
3566
|
-
if (advancedChunks == null) return;
|
|
3567
|
-
const { groups,...restAdvancedChunks } = advancedChunks;
|
|
3568
|
-
return {
|
|
3569
|
-
...restAdvancedChunks,
|
|
3570
|
-
groups: groups?.map((group) => {
|
|
3571
|
-
const { name,...restGroup } = group;
|
|
3572
|
-
return {
|
|
3573
|
-
...restGroup,
|
|
3574
|
-
name: typeof name === "function" ? (id$1, ctx) => name(id$1, new ChunkingContextImpl(ctx)) : name
|
|
3575
|
-
};
|
|
3576
|
-
})
|
|
3577
|
-
};
|
|
3578
|
-
}
|
|
3579
|
-
|
|
3580
3451
|
//#endregion
|
|
3581
3452
|
//#region src/options/normalized-output-options.ts
|
|
3582
3453
|
var NormalizedOutputOptionsImpl = class {
|
|
@@ -3658,7 +3529,7 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3658
3529
|
return this.inner.sourcemapDebugIds;
|
|
3659
3530
|
}
|
|
3660
3531
|
get sourcemapIgnoreList() {
|
|
3661
|
-
return
|
|
3532
|
+
return this.outputOptions.sourcemapIgnoreList;
|
|
3662
3533
|
}
|
|
3663
3534
|
get sourcemapPathTransform() {
|
|
3664
3535
|
return this.outputOptions.sourcemapPathTransform;
|
|
@@ -3708,7 +3579,6 @@ var PluginContextData = class {
|
|
|
3708
3579
|
moduleOptionMap = /* @__PURE__ */ new Map();
|
|
3709
3580
|
resolveOptionsMap = /* @__PURE__ */ new Map();
|
|
3710
3581
|
loadModulePromiseMap = /* @__PURE__ */ new Map();
|
|
3711
|
-
loadModulePromiseResolveFnMap = /* @__PURE__ */ new Map();
|
|
3712
3582
|
renderedChunkMeta = null;
|
|
3713
3583
|
normalizedInputOptions = null;
|
|
3714
3584
|
normalizedOutputOptions = null;
|
|
@@ -3794,14 +3664,9 @@ var PluginContextData = class {
|
|
|
3794
3664
|
this.normalizedOutputOptions ??= new NormalizedOutputOptionsImpl(opts, this.outputOptions, this.normalizedOutputPlugins);
|
|
3795
3665
|
return this.normalizedOutputOptions;
|
|
3796
3666
|
}
|
|
3797
|
-
markModuleLoaded(id$1, _success) {
|
|
3798
|
-
const resolve = this.loadModulePromiseResolveFnMap.get(id$1);
|
|
3799
|
-
if (resolve) resolve();
|
|
3800
|
-
}
|
|
3801
3667
|
clear() {
|
|
3802
3668
|
this.renderedChunkMeta = null;
|
|
3803
3669
|
this.loadModulePromiseMap.clear();
|
|
3804
|
-
this.loadModulePromiseResolveFnMap.clear();
|
|
3805
3670
|
}
|
|
3806
3671
|
};
|
|
3807
3672
|
|
|
@@ -3861,7 +3726,6 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3861
3726
|
makeAbsoluteExternalsRelative: bindingifyMakeAbsoluteExternalsRelative(inputOptions.makeAbsoluteExternalsRelative),
|
|
3862
3727
|
debug: inputOptions.debug,
|
|
3863
3728
|
invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
|
|
3864
|
-
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
3865
3729
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
3866
3730
|
optimization: inputOptions.optimization,
|
|
3867
3731
|
context: inputOptions.context,
|
|
@@ -4082,6 +3946,127 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
|
4082
3946
|
};
|
|
4083
3947
|
}
|
|
4084
3948
|
|
|
3949
|
+
//#endregion
|
|
3950
|
+
//#region src/types/chunking-context.ts
|
|
3951
|
+
var ChunkingContextImpl = class {
|
|
3952
|
+
constructor(context) {
|
|
3953
|
+
this.context = context;
|
|
3954
|
+
}
|
|
3955
|
+
getModuleInfo(moduleId) {
|
|
3956
|
+
const bindingInfo = this.context.getModuleInfo(moduleId);
|
|
3957
|
+
if (bindingInfo) return transformModuleInfo(bindingInfo, {
|
|
3958
|
+
moduleSideEffects: null,
|
|
3959
|
+
meta: {}
|
|
3960
|
+
});
|
|
3961
|
+
return null;
|
|
3962
|
+
}
|
|
3963
|
+
};
|
|
3964
|
+
|
|
3965
|
+
//#endregion
|
|
3966
|
+
//#region src/utils/bindingify-output-options.ts
|
|
3967
|
+
function bindingifyOutputOptions(outputOptions) {
|
|
3968
|
+
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3969
|
+
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3970
|
+
return {
|
|
3971
|
+
dir,
|
|
3972
|
+
file: file == null ? void 0 : file,
|
|
3973
|
+
format: bindingifyFormat(format),
|
|
3974
|
+
exports,
|
|
3975
|
+
hashCharacters,
|
|
3976
|
+
sourcemap: bindingifySourcemap(sourcemap),
|
|
3977
|
+
sourcemapBaseUrl,
|
|
3978
|
+
sourcemapDebugIds,
|
|
3979
|
+
sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules/,
|
|
3980
|
+
sourcemapPathTransform,
|
|
3981
|
+
banner: bindingifyAddon(banner),
|
|
3982
|
+
footer: bindingifyAddon(footer),
|
|
3983
|
+
intro: bindingifyAddon(intro),
|
|
3984
|
+
outro: bindingifyAddon(outro),
|
|
3985
|
+
extend: outputOptions.extend,
|
|
3986
|
+
globals,
|
|
3987
|
+
esModule,
|
|
3988
|
+
name,
|
|
3989
|
+
assetFileNames: bindingifyAssetFilenames(assetFileNames),
|
|
3990
|
+
entryFileNames,
|
|
3991
|
+
chunkFileNames,
|
|
3992
|
+
cssEntryFileNames,
|
|
3993
|
+
cssChunkFileNames,
|
|
3994
|
+
plugins: [],
|
|
3995
|
+
minify: outputOptions.minify,
|
|
3996
|
+
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
3997
|
+
inlineDynamicImports: outputOptions.inlineDynamicImports,
|
|
3998
|
+
advancedChunks,
|
|
3999
|
+
polyfillRequire: outputOptions.polyfillRequire,
|
|
4000
|
+
sanitizeFileName,
|
|
4001
|
+
preserveModules,
|
|
4002
|
+
virtualDirname,
|
|
4003
|
+
legalComments,
|
|
4004
|
+
preserveModulesRoot,
|
|
4005
|
+
topLevelVar,
|
|
4006
|
+
minifyInternalExports: outputOptions.minifyInternalExports
|
|
4007
|
+
};
|
|
4008
|
+
}
|
|
4009
|
+
function bindingifyAddon(configAddon) {
|
|
4010
|
+
return async (chunk) => {
|
|
4011
|
+
if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
|
|
4012
|
+
return configAddon || "";
|
|
4013
|
+
};
|
|
4014
|
+
}
|
|
4015
|
+
function bindingifyFormat(format) {
|
|
4016
|
+
switch (format) {
|
|
4017
|
+
case void 0:
|
|
4018
|
+
case "es":
|
|
4019
|
+
case "esm":
|
|
4020
|
+
case "module": return "es";
|
|
4021
|
+
case "cjs":
|
|
4022
|
+
case "commonjs": return "cjs";
|
|
4023
|
+
case "iife": return "iife";
|
|
4024
|
+
case "umd": return "umd";
|
|
4025
|
+
default: unimplemented(`output.format: ${format}`);
|
|
4026
|
+
}
|
|
4027
|
+
}
|
|
4028
|
+
function bindingifySourcemap(sourcemap) {
|
|
4029
|
+
switch (sourcemap) {
|
|
4030
|
+
case true: return "file";
|
|
4031
|
+
case "inline": return "inline";
|
|
4032
|
+
case false:
|
|
4033
|
+
case void 0: return;
|
|
4034
|
+
case "hidden": return "hidden";
|
|
4035
|
+
default: throw new Error(`unknown sourcemap: ${sourcemap}`);
|
|
4036
|
+
}
|
|
4037
|
+
}
|
|
4038
|
+
function bindingifyAssetFilenames(assetFileNames) {
|
|
4039
|
+
if (typeof assetFileNames === "function") return (asset) => {
|
|
4040
|
+
return assetFileNames({
|
|
4041
|
+
name: asset.name,
|
|
4042
|
+
names: asset.names,
|
|
4043
|
+
originalFileName: asset.originalFileName,
|
|
4044
|
+
originalFileNames: asset.originalFileNames,
|
|
4045
|
+
source: transformAssetSource(asset.source),
|
|
4046
|
+
type: "asset"
|
|
4047
|
+
});
|
|
4048
|
+
};
|
|
4049
|
+
return assetFileNames;
|
|
4050
|
+
}
|
|
4051
|
+
function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
|
|
4052
|
+
if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
|
|
4053
|
+
else if (manualChunks != null) advancedChunks = { groups: [{ name(moduleId, ctx) {
|
|
4054
|
+
return manualChunks(moduleId, { getModuleInfo: (id$1) => ctx.getModuleInfo(id$1) });
|
|
4055
|
+
} }] };
|
|
4056
|
+
if (advancedChunks == null) return;
|
|
4057
|
+
const { groups,...restAdvancedChunks } = advancedChunks;
|
|
4058
|
+
return {
|
|
4059
|
+
...restAdvancedChunks,
|
|
4060
|
+
groups: groups?.map((group) => {
|
|
4061
|
+
const { name,...restGroup } = group;
|
|
4062
|
+
return {
|
|
4063
|
+
...restGroup,
|
|
4064
|
+
name: typeof name === "function" ? (id$1, ctx) => name(id$1, new ChunkingContextImpl(ctx)) : name
|
|
4065
|
+
};
|
|
4066
|
+
})
|
|
4067
|
+
};
|
|
4068
|
+
}
|
|
4069
|
+
|
|
4085
4070
|
//#endregion
|
|
4086
4071
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
4087
4072
|
async function initializeParallelPlugins(plugins) {
|
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region package.json
|
|
30
|
-
var version = "1.0.0-beta.
|
|
30
|
+
var version = "1.0.0-beta.40";
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/utils/code-frame.ts
|
|
@@ -2470,7 +2470,11 @@ const OutputOptionsSchema = strictObject({
|
|
|
2470
2470
|
])), description(`Generate sourcemap (\`-s inline\` for inline, or ${ansis_default.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
|
|
2471
2471
|
sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
|
|
2472
2472
|
sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
|
|
2473
|
-
sourcemapIgnoreList: optional(union([
|
|
2473
|
+
sourcemapIgnoreList: optional(union([
|
|
2474
|
+
boolean(),
|
|
2475
|
+
custom(() => true),
|
|
2476
|
+
StringOrRegExpSchema
|
|
2477
|
+
])),
|
|
2474
2478
|
sourcemapPathTransform: optional(custom(() => true)),
|
|
2475
2479
|
banner: optional(union([string(), AddonFunctionSchema])),
|
|
2476
2480
|
footer: optional(union([string(), AddonFunctionSchema])),
|
|
@@ -2767,7 +2771,7 @@ function exclude(expr) {
|
|
|
2767
2771
|
}
|
|
2768
2772
|
|
|
2769
2773
|
//#endregion
|
|
2770
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2774
|
+
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
|
|
2771
2775
|
function e(e$2, t$3, n$2) {
|
|
2772
2776
|
let r$1 = (n$3) => e$2(n$3, ...t$3);
|
|
2773
2777
|
return n$2 === void 0 ? r$1 : Object.assign(r$1, {
|
|
@@ -2777,7 +2781,7 @@ function e(e$2, t$3, n$2) {
|
|
|
2777
2781
|
}
|
|
2778
2782
|
|
|
2779
2783
|
//#endregion
|
|
2780
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2784
|
+
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
|
|
2781
2785
|
function t(t$3, n$2, r$1) {
|
|
2782
2786
|
let i$1 = t$3.length - n$2.length;
|
|
2783
2787
|
if (i$1 === 0) return t$3(...n$2);
|
|
@@ -2786,7 +2790,7 @@ function t(t$3, n$2, r$1) {
|
|
|
2786
2790
|
}
|
|
2787
2791
|
|
|
2788
2792
|
//#endregion
|
|
2789
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2793
|
+
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/partition-DAu403JQ.js
|
|
2790
2794
|
function t$1(...t$3) {
|
|
2791
2795
|
return t(n, t$3);
|
|
2792
2796
|
}
|
|
@@ -2946,7 +2950,7 @@ function bindingPluginOrder(order) {
|
|
|
2946
2950
|
}
|
|
2947
2951
|
|
|
2948
2952
|
//#endregion
|
|
2949
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2953
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.92.0/node_modules/oxc-parser/src-js/wrap.js
|
|
2950
2954
|
function wrap$1(result) {
|
|
2951
2955
|
let program, module$1, comments, errors;
|
|
2952
2956
|
return {
|
|
@@ -3073,23 +3077,14 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3073
3077
|
invalidate: false
|
|
3074
3078
|
};
|
|
3075
3079
|
this.data.updateModuleOption(id$1, rawOptions);
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
data.loadModulePromiseResolveFnMap.set(id$1, resolve$1);
|
|
3080
|
+
let loadPromise = this.data.loadModulePromiseMap.get(id$1);
|
|
3081
|
+
if (!loadPromise) {
|
|
3082
|
+
loadPromise = this.context.load(id$1, options.moduleSideEffects ?? void 0).catch(() => {
|
|
3083
|
+
this.data.loadModulePromiseMap.delete(id$1);
|
|
3081
3084
|
});
|
|
3082
|
-
data.loadModulePromiseMap.set(id$1,
|
|
3083
|
-
try {
|
|
3084
|
-
await context.load(id$1, options.moduleSideEffects ?? void 0);
|
|
3085
|
-
} catch (e$2) {
|
|
3086
|
-
data.loadModulePromiseMap.delete(id$1);
|
|
3087
|
-
data.loadModulePromiseResolveFnMap.delete(id$1);
|
|
3088
|
-
throw e$2;
|
|
3089
|
-
}
|
|
3090
|
-
return promise$1;
|
|
3085
|
+
this.data.loadModulePromiseMap.set(id$1, loadPromise);
|
|
3091
3086
|
}
|
|
3092
|
-
await
|
|
3087
|
+
await loadPromise;
|
|
3093
3088
|
return this.data.getModuleInfo(id$1, this.context);
|
|
3094
3089
|
}
|
|
3095
3090
|
async resolve(source, importer, options) {
|
|
@@ -3954,130 +3949,6 @@ var NormalizedInputOptionsImpl = class {
|
|
|
3954
3949
|
}
|
|
3955
3950
|
};
|
|
3956
3951
|
|
|
3957
|
-
//#endregion
|
|
3958
|
-
//#region src/types/chunking-context.ts
|
|
3959
|
-
var ChunkingContextImpl = class {
|
|
3960
|
-
constructor(context) {
|
|
3961
|
-
this.context = context;
|
|
3962
|
-
}
|
|
3963
|
-
getModuleInfo(moduleId) {
|
|
3964
|
-
const bindingInfo = this.context.getModuleInfo(moduleId);
|
|
3965
|
-
if (bindingInfo) return transformModuleInfo(bindingInfo, {
|
|
3966
|
-
moduleSideEffects: null,
|
|
3967
|
-
meta: {}
|
|
3968
|
-
});
|
|
3969
|
-
return null;
|
|
3970
|
-
}
|
|
3971
|
-
};
|
|
3972
|
-
|
|
3973
|
-
//#endregion
|
|
3974
|
-
//#region src/utils/bindingify-output-options.ts
|
|
3975
|
-
function bindingifyOutputOptions(outputOptions) {
|
|
3976
|
-
const { dir, format: format$1, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3977
|
-
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3978
|
-
return {
|
|
3979
|
-
dir,
|
|
3980
|
-
file: file == null ? void 0 : file,
|
|
3981
|
-
format: bindingifyFormat(format$1),
|
|
3982
|
-
exports,
|
|
3983
|
-
hashCharacters,
|
|
3984
|
-
sourcemap: bindingifySourcemap(sourcemap),
|
|
3985
|
-
sourcemapBaseUrl,
|
|
3986
|
-
sourcemapDebugIds,
|
|
3987
|
-
sourcemapIgnoreList: bindingifySourcemapIgnoreList(sourcemapIgnoreList),
|
|
3988
|
-
sourcemapPathTransform,
|
|
3989
|
-
banner: bindingifyAddon(banner),
|
|
3990
|
-
footer: bindingifyAddon(footer),
|
|
3991
|
-
intro: bindingifyAddon(intro),
|
|
3992
|
-
outro: bindingifyAddon(outro),
|
|
3993
|
-
extend: outputOptions.extend,
|
|
3994
|
-
globals,
|
|
3995
|
-
esModule,
|
|
3996
|
-
name,
|
|
3997
|
-
assetFileNames: bindingifyAssetFilenames(assetFileNames),
|
|
3998
|
-
entryFileNames,
|
|
3999
|
-
chunkFileNames,
|
|
4000
|
-
cssEntryFileNames,
|
|
4001
|
-
cssChunkFileNames,
|
|
4002
|
-
plugins: [],
|
|
4003
|
-
minify: outputOptions.minify,
|
|
4004
|
-
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
4005
|
-
inlineDynamicImports: outputOptions.inlineDynamicImports,
|
|
4006
|
-
advancedChunks,
|
|
4007
|
-
polyfillRequire: outputOptions.polyfillRequire,
|
|
4008
|
-
sanitizeFileName,
|
|
4009
|
-
preserveModules,
|
|
4010
|
-
virtualDirname,
|
|
4011
|
-
legalComments,
|
|
4012
|
-
preserveModulesRoot,
|
|
4013
|
-
topLevelVar,
|
|
4014
|
-
minifyInternalExports: outputOptions.minifyInternalExports
|
|
4015
|
-
};
|
|
4016
|
-
}
|
|
4017
|
-
function bindingifyAddon(configAddon) {
|
|
4018
|
-
return async (chunk) => {
|
|
4019
|
-
if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
|
|
4020
|
-
return configAddon || "";
|
|
4021
|
-
};
|
|
4022
|
-
}
|
|
4023
|
-
function bindingifyFormat(format$1) {
|
|
4024
|
-
switch (format$1) {
|
|
4025
|
-
case void 0:
|
|
4026
|
-
case "es":
|
|
4027
|
-
case "esm":
|
|
4028
|
-
case "module": return "es";
|
|
4029
|
-
case "cjs":
|
|
4030
|
-
case "commonjs": return "cjs";
|
|
4031
|
-
case "iife": return "iife";
|
|
4032
|
-
case "umd": return "umd";
|
|
4033
|
-
default: unimplemented(`output.format: ${format$1}`);
|
|
4034
|
-
}
|
|
4035
|
-
}
|
|
4036
|
-
function bindingifySourcemap(sourcemap) {
|
|
4037
|
-
switch (sourcemap) {
|
|
4038
|
-
case true: return "file";
|
|
4039
|
-
case "inline": return "inline";
|
|
4040
|
-
case false:
|
|
4041
|
-
case void 0: return;
|
|
4042
|
-
case "hidden": return "hidden";
|
|
4043
|
-
default: throw new Error(`unknown sourcemap: ${sourcemap}`);
|
|
4044
|
-
}
|
|
4045
|
-
}
|
|
4046
|
-
function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
|
|
4047
|
-
return typeof sourcemapIgnoreList === "function" ? sourcemapIgnoreList : sourcemapIgnoreList === false ? () => false : (relativeSourcePath, _sourcemapPath) => relativeSourcePath.includes("node_modules");
|
|
4048
|
-
}
|
|
4049
|
-
function bindingifyAssetFilenames(assetFileNames) {
|
|
4050
|
-
if (typeof assetFileNames === "function") return (asset) => {
|
|
4051
|
-
return assetFileNames({
|
|
4052
|
-
name: asset.name,
|
|
4053
|
-
names: asset.names,
|
|
4054
|
-
originalFileName: asset.originalFileName,
|
|
4055
|
-
originalFileNames: asset.originalFileNames,
|
|
4056
|
-
source: transformAssetSource(asset.source),
|
|
4057
|
-
type: "asset"
|
|
4058
|
-
});
|
|
4059
|
-
};
|
|
4060
|
-
return assetFileNames;
|
|
4061
|
-
}
|
|
4062
|
-
function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
|
|
4063
|
-
if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
|
|
4064
|
-
else if (manualChunks != null) advancedChunks = { groups: [{ name(moduleId, ctx) {
|
|
4065
|
-
return manualChunks(moduleId, { getModuleInfo: (id$1) => ctx.getModuleInfo(id$1) });
|
|
4066
|
-
} }] };
|
|
4067
|
-
if (advancedChunks == null) return;
|
|
4068
|
-
const { groups,...restAdvancedChunks } = advancedChunks;
|
|
4069
|
-
return {
|
|
4070
|
-
...restAdvancedChunks,
|
|
4071
|
-
groups: groups?.map((group) => {
|
|
4072
|
-
const { name,...restGroup } = group;
|
|
4073
|
-
return {
|
|
4074
|
-
...restGroup,
|
|
4075
|
-
name: typeof name === "function" ? (id$1, ctx) => name(id$1, new ChunkingContextImpl(ctx)) : name
|
|
4076
|
-
};
|
|
4077
|
-
})
|
|
4078
|
-
};
|
|
4079
|
-
}
|
|
4080
|
-
|
|
4081
3952
|
//#endregion
|
|
4082
3953
|
//#region src/options/normalized-output-options.ts
|
|
4083
3954
|
var NormalizedOutputOptionsImpl = class {
|
|
@@ -4159,7 +4030,7 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
4159
4030
|
return this.inner.sourcemapDebugIds;
|
|
4160
4031
|
}
|
|
4161
4032
|
get sourcemapIgnoreList() {
|
|
4162
|
-
return
|
|
4033
|
+
return this.outputOptions.sourcemapIgnoreList;
|
|
4163
4034
|
}
|
|
4164
4035
|
get sourcemapPathTransform() {
|
|
4165
4036
|
return this.outputOptions.sourcemapPathTransform;
|
|
@@ -4209,7 +4080,6 @@ var PluginContextData = class {
|
|
|
4209
4080
|
moduleOptionMap = /* @__PURE__ */ new Map();
|
|
4210
4081
|
resolveOptionsMap = /* @__PURE__ */ new Map();
|
|
4211
4082
|
loadModulePromiseMap = /* @__PURE__ */ new Map();
|
|
4212
|
-
loadModulePromiseResolveFnMap = /* @__PURE__ */ new Map();
|
|
4213
4083
|
renderedChunkMeta = null;
|
|
4214
4084
|
normalizedInputOptions = null;
|
|
4215
4085
|
normalizedOutputOptions = null;
|
|
@@ -4295,14 +4165,9 @@ var PluginContextData = class {
|
|
|
4295
4165
|
this.normalizedOutputOptions ??= new NormalizedOutputOptionsImpl(opts, this.outputOptions, this.normalizedOutputPlugins);
|
|
4296
4166
|
return this.normalizedOutputOptions;
|
|
4297
4167
|
}
|
|
4298
|
-
markModuleLoaded(id$1, _success) {
|
|
4299
|
-
const resolve$1 = this.loadModulePromiseResolveFnMap.get(id$1);
|
|
4300
|
-
if (resolve$1) resolve$1();
|
|
4301
|
-
}
|
|
4302
4168
|
clear() {
|
|
4303
4169
|
this.renderedChunkMeta = null;
|
|
4304
4170
|
this.loadModulePromiseMap.clear();
|
|
4305
|
-
this.loadModulePromiseResolveFnMap.clear();
|
|
4306
4171
|
}
|
|
4307
4172
|
};
|
|
4308
4173
|
|
|
@@ -4362,7 +4227,6 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4362
4227
|
makeAbsoluteExternalsRelative: bindingifyMakeAbsoluteExternalsRelative(inputOptions.makeAbsoluteExternalsRelative),
|
|
4363
4228
|
debug: inputOptions.debug,
|
|
4364
4229
|
invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
|
|
4365
|
-
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
4366
4230
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
4367
4231
|
optimization: inputOptions.optimization,
|
|
4368
4232
|
context: inputOptions.context,
|
|
@@ -4583,6 +4447,127 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
|
4583
4447
|
};
|
|
4584
4448
|
}
|
|
4585
4449
|
|
|
4450
|
+
//#endregion
|
|
4451
|
+
//#region src/types/chunking-context.ts
|
|
4452
|
+
var ChunkingContextImpl = class {
|
|
4453
|
+
constructor(context) {
|
|
4454
|
+
this.context = context;
|
|
4455
|
+
}
|
|
4456
|
+
getModuleInfo(moduleId) {
|
|
4457
|
+
const bindingInfo = this.context.getModuleInfo(moduleId);
|
|
4458
|
+
if (bindingInfo) return transformModuleInfo(bindingInfo, {
|
|
4459
|
+
moduleSideEffects: null,
|
|
4460
|
+
meta: {}
|
|
4461
|
+
});
|
|
4462
|
+
return null;
|
|
4463
|
+
}
|
|
4464
|
+
};
|
|
4465
|
+
|
|
4466
|
+
//#endregion
|
|
4467
|
+
//#region src/utils/bindingify-output-options.ts
|
|
4468
|
+
function bindingifyOutputOptions(outputOptions) {
|
|
4469
|
+
const { dir, format: format$1, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
4470
|
+
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
4471
|
+
return {
|
|
4472
|
+
dir,
|
|
4473
|
+
file: file == null ? void 0 : file,
|
|
4474
|
+
format: bindingifyFormat(format$1),
|
|
4475
|
+
exports,
|
|
4476
|
+
hashCharacters,
|
|
4477
|
+
sourcemap: bindingifySourcemap(sourcemap),
|
|
4478
|
+
sourcemapBaseUrl,
|
|
4479
|
+
sourcemapDebugIds,
|
|
4480
|
+
sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules/,
|
|
4481
|
+
sourcemapPathTransform,
|
|
4482
|
+
banner: bindingifyAddon(banner),
|
|
4483
|
+
footer: bindingifyAddon(footer),
|
|
4484
|
+
intro: bindingifyAddon(intro),
|
|
4485
|
+
outro: bindingifyAddon(outro),
|
|
4486
|
+
extend: outputOptions.extend,
|
|
4487
|
+
globals,
|
|
4488
|
+
esModule,
|
|
4489
|
+
name,
|
|
4490
|
+
assetFileNames: bindingifyAssetFilenames(assetFileNames),
|
|
4491
|
+
entryFileNames,
|
|
4492
|
+
chunkFileNames,
|
|
4493
|
+
cssEntryFileNames,
|
|
4494
|
+
cssChunkFileNames,
|
|
4495
|
+
plugins: [],
|
|
4496
|
+
minify: outputOptions.minify,
|
|
4497
|
+
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
4498
|
+
inlineDynamicImports: outputOptions.inlineDynamicImports,
|
|
4499
|
+
advancedChunks,
|
|
4500
|
+
polyfillRequire: outputOptions.polyfillRequire,
|
|
4501
|
+
sanitizeFileName,
|
|
4502
|
+
preserveModules,
|
|
4503
|
+
virtualDirname,
|
|
4504
|
+
legalComments,
|
|
4505
|
+
preserveModulesRoot,
|
|
4506
|
+
topLevelVar,
|
|
4507
|
+
minifyInternalExports: outputOptions.minifyInternalExports
|
|
4508
|
+
};
|
|
4509
|
+
}
|
|
4510
|
+
function bindingifyAddon(configAddon) {
|
|
4511
|
+
return async (chunk) => {
|
|
4512
|
+
if (typeof configAddon === "function") return configAddon(transformRenderedChunk(chunk));
|
|
4513
|
+
return configAddon || "";
|
|
4514
|
+
};
|
|
4515
|
+
}
|
|
4516
|
+
function bindingifyFormat(format$1) {
|
|
4517
|
+
switch (format$1) {
|
|
4518
|
+
case void 0:
|
|
4519
|
+
case "es":
|
|
4520
|
+
case "esm":
|
|
4521
|
+
case "module": return "es";
|
|
4522
|
+
case "cjs":
|
|
4523
|
+
case "commonjs": return "cjs";
|
|
4524
|
+
case "iife": return "iife";
|
|
4525
|
+
case "umd": return "umd";
|
|
4526
|
+
default: unimplemented(`output.format: ${format$1}`);
|
|
4527
|
+
}
|
|
4528
|
+
}
|
|
4529
|
+
function bindingifySourcemap(sourcemap) {
|
|
4530
|
+
switch (sourcemap) {
|
|
4531
|
+
case true: return "file";
|
|
4532
|
+
case "inline": return "inline";
|
|
4533
|
+
case false:
|
|
4534
|
+
case void 0: return;
|
|
4535
|
+
case "hidden": return "hidden";
|
|
4536
|
+
default: throw new Error(`unknown sourcemap: ${sourcemap}`);
|
|
4537
|
+
}
|
|
4538
|
+
}
|
|
4539
|
+
function bindingifyAssetFilenames(assetFileNames) {
|
|
4540
|
+
if (typeof assetFileNames === "function") return (asset) => {
|
|
4541
|
+
return assetFileNames({
|
|
4542
|
+
name: asset.name,
|
|
4543
|
+
names: asset.names,
|
|
4544
|
+
originalFileName: asset.originalFileName,
|
|
4545
|
+
originalFileNames: asset.originalFileNames,
|
|
4546
|
+
source: transformAssetSource(asset.source),
|
|
4547
|
+
type: "asset"
|
|
4548
|
+
});
|
|
4549
|
+
};
|
|
4550
|
+
return assetFileNames;
|
|
4551
|
+
}
|
|
4552
|
+
function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
|
|
4553
|
+
if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
|
|
4554
|
+
else if (manualChunks != null) advancedChunks = { groups: [{ name(moduleId, ctx) {
|
|
4555
|
+
return manualChunks(moduleId, { getModuleInfo: (id$1) => ctx.getModuleInfo(id$1) });
|
|
4556
|
+
} }] };
|
|
4557
|
+
if (advancedChunks == null) return;
|
|
4558
|
+
const { groups,...restAdvancedChunks } = advancedChunks;
|
|
4559
|
+
return {
|
|
4560
|
+
...restAdvancedChunks,
|
|
4561
|
+
groups: groups?.map((group) => {
|
|
4562
|
+
const { name,...restGroup } = group;
|
|
4563
|
+
return {
|
|
4564
|
+
...restGroup,
|
|
4565
|
+
name: typeof name === "function" ? (id$1, ctx) => name(id$1, new ChunkingContextImpl(ctx)) : name
|
|
4566
|
+
};
|
|
4567
|
+
})
|
|
4568
|
+
};
|
|
4569
|
+
}
|
|
4570
|
+
|
|
4586
4571
|
//#endregion
|
|
4587
4572
|
//#region src/utils/create-bundler-option.ts
|
|
4588
4573
|
async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
package/package.json
CHANGED