@rolldown/browser 1.0.0-beta.34 → 1.0.0-beta.36
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 +219 -230
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.browser.mjs +22 -6
- package/dist/experimental-index.d.mts +16 -4
- package/dist/experimental-index.mjs +24 -8
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/parallel-plugin-worker.mjs +5 -6
- 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 +4 -0
- package/dist/rolldown-binding.wasi.cjs +4 -0
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-9k0egz6L.d.mts → binding-wK0CRIMb.d.mts} +1 -0
- package/dist/shared/{define-config-DzIQxNqU.d.mts → define-config-BcNhk996.d.mts} +30 -3
- package/dist/shared/{dist-ByKQkexh.mjs → dist-CHTC3-kR.mjs} +1 -1
- package/dist/shared/{load-config--VYNOtUY.mjs → load-config-M8Gvqt1X.mjs} +4 -6
- package/dist/shared/{parse-ast-index-C_CZT4St.mjs → parse-ast-index-C3TkGcEQ.mjs} +1 -1
- package/dist/shared/{prompt-C5jz26Zn.mjs → prompt-DuG2i9ud.mjs} +4 -7
- package/dist/shared/{src-B4V64IkU.mjs → src-Dc4fRARy.mjs} +143 -72
- package/dist/{src-Bl12Y5ab.js → src-Cl6h35QH.js} +141 -71
- package/package.json +10 -24
- package/dist/cli.cjs +0 -1766
- package/dist/cli.d.cts +0 -1
- package/dist/config.cjs +0 -12
- package/dist/config.d.cts +0 -10
- package/dist/experimental-index.cjs +0 -160
- package/dist/experimental-index.d.cts +0 -90
- package/dist/filter-index.cjs +0 -53
- package/dist/filter-index.d.cts +0 -4
- package/dist/index.cjs +0 -9
- package/dist/index.d.cts +0 -3
- package/dist/parallel-plugin-worker.cjs +0 -33
- package/dist/parallel-plugin-worker.d.cts +0 -1
- package/dist/parallel-plugin.cjs +0 -8
- package/dist/parallel-plugin.d.cts +0 -14
- package/dist/parse-ast-index.cjs +0 -4
- package/dist/parse-ast-index.d.cts +0 -8
- package/dist/shared/binding-D13M6Llu.d.cts +0 -1425
- package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
- package/dist/shared/define-config-D5AluabE.d.cts +0 -1394
- package/dist/shared/dist-CK0hotcm.cjs +0 -240
- package/dist/shared/load-config-DfHD1OI9.cjs +0 -125
- package/dist/shared/parse-ast-index-ChWj_C49.cjs +0 -326
- package/dist/shared/prompt-QNI93ne7.cjs +0 -854
- package/dist/shared/src-McCMqGpa.cjs +0 -4738
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import "./shared/dist-
|
|
1
|
+
import { PluginDriver, assetPlugin, buildImportAnalysisPlugin, createBuiltinPlugin, createBundlerImpl, createBundlerOptions, dynamicImportVarsPlugin, esmExternalRequirePlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/src-Dc4fRARy.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-C3TkGcEQ.mjs";
|
|
3
|
+
import "./shared/dist-CHTC3-kR.mjs";
|
|
4
4
|
import { BindingBundler, BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
|
|
@@ -8,10 +8,17 @@ import { pathToFileURL } from "node:url";
|
|
|
8
8
|
var DevEngine = class DevEngine {
|
|
9
9
|
#inner;
|
|
10
10
|
#cachedBuildFinishPromise = null;
|
|
11
|
-
static async create(inputOptions, outputOptions) {
|
|
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
|
|
14
|
+
const bindingDevOptions = {
|
|
15
|
+
onHmrUpdates: devOptions.onHmrUpdates,
|
|
16
|
+
watch: devOptions.watch && {
|
|
17
|
+
usePolling: devOptions.watch.usePolling,
|
|
18
|
+
pollInterval: devOptions.watch.pollInterval
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const inner = new BindingDevEngine(options.bundlerOptions, bindingDevOptions);
|
|
15
22
|
return new DevEngine(inner);
|
|
16
23
|
}
|
|
17
24
|
constructor(inner) {
|
|
@@ -28,6 +35,12 @@ var DevEngine = class DevEngine {
|
|
|
28
35
|
this.#cachedBuildFinishPromise = promise;
|
|
29
36
|
return promise;
|
|
30
37
|
}
|
|
38
|
+
async ensureLatestBuild() {
|
|
39
|
+
await this.#inner.ensureLatestBuild();
|
|
40
|
+
}
|
|
41
|
+
async invalidate(file, firstInvalidatedBy) {
|
|
42
|
+
return this.#inner.invalidate(file, firstInvalidatedBy);
|
|
43
|
+
}
|
|
31
44
|
};
|
|
32
45
|
|
|
33
46
|
//#endregion
|
|
@@ -63,7 +76,7 @@ function defineParallelPlugin(pluginPath) {
|
|
|
63
76
|
//#endregion
|
|
64
77
|
//#region src/builtin-plugin/alias-plugin.ts
|
|
65
78
|
function aliasPlugin(config) {
|
|
66
|
-
return
|
|
79
|
+
return createBuiltinPlugin("builtin:alias", config);
|
|
67
80
|
}
|
|
68
81
|
|
|
69
82
|
//#endregion
|
|
@@ -91,7 +104,10 @@ function aliasPlugin(config) {
|
|
|
91
104
|
* ```
|
|
92
105
|
*/
|
|
93
106
|
function replacePlugin(values = {}, options = {}) {
|
|
94
|
-
|
|
107
|
+
Object.keys(values).forEach((key) => {
|
|
108
|
+
values[key] = values[key].toString();
|
|
109
|
+
});
|
|
110
|
+
return createBuiltinPlugin("builtin:replace", {
|
|
95
111
|
...options,
|
|
96
112
|
values
|
|
97
113
|
});
|
|
@@ -107,7 +123,7 @@ function transformPlugin(config) {
|
|
|
107
123
|
jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
|
|
108
124
|
jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude)
|
|
109
125
|
};
|
|
110
|
-
return
|
|
126
|
+
return createBuiltinPlugin("builtin:transform", config);
|
|
111
127
|
}
|
|
112
128
|
|
|
113
129
|
//#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-wK0CRIMb.mjs";
|
|
2
|
+
import { withFilter } from "./shared/define-config-BcNhk996.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/filter-index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { and, arraify, code, exclude, id, include, isPromiseLike, moduleType, not, or, queries, query } from "./shared/dist-
|
|
1
|
+
import { and, arraify, code, exclude, id, include, isPromiseLike, moduleType, not, or, queries, query } from "./shared/dist-CHTC3-kR.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/with-filter.ts
|
|
4
4
|
function withFilterImpl(pluginOption, filterObjectList) {
|
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, 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-wK0CRIMb.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, 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-BcNhk996.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, 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-
|
|
3
|
-
import "./shared/dist-
|
|
1
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-Dc4fRARy.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-C3TkGcEQ.mjs";
|
|
3
|
+
import "./shared/dist-CHTC3-kR.mjs";
|
|
4
4
|
|
|
5
5
|
export { VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { PluginContextData, bindingifyPlugin } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import "./shared/dist-
|
|
4
|
-
import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
|
1
|
+
import { PluginContextData, bindingifyPlugin } from "./shared/src-Dc4fRARy.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-C3TkGcEQ.mjs";
|
|
3
|
+
import "./shared/dist-CHTC3-kR.mjs";
|
|
5
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
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;
|
|
9
9
|
(async () => {
|
|
10
10
|
try {
|
|
11
11
|
const plugins = await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
12
|
-
const
|
|
13
|
-
const definePluginImpl = pluginModule.default;
|
|
12
|
+
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
|
|
14
13
|
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
15
14
|
return {
|
|
16
15
|
index: pluginInfo.index,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { MaybePromise, Plugin } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-wK0CRIMb.mjs";
|
|
2
|
+
import { MaybePromise, Plugin } from "./shared/define-config-BcNhk996.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
|
@@ -103,13 +103,17 @@ export const BindingWatcher = __napiModule.exports.BindingWatcher
|
|
|
103
103
|
export const BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
|
|
104
104
|
export const BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
105
105
|
export const ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
|
|
106
|
+
export const TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
106
107
|
export const BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
107
108
|
export const BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
108
109
|
export const BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
109
110
|
export const BindingJsx = __napiModule.exports.BindingJsx
|
|
110
111
|
export const BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
111
112
|
export const BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
113
|
+
export const BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
114
|
+
export const BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
112
115
|
export const FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
116
|
+
export const initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
113
117
|
export const registerPlugins = __napiModule.exports.registerPlugins
|
|
114
118
|
export const shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
115
119
|
export const startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
@@ -148,13 +148,17 @@ module.exports.BindingWatcher = __napiModule.exports.BindingWatcher
|
|
|
148
148
|
module.exports.BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
|
|
149
149
|
module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
150
150
|
module.exports.ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
|
|
151
|
+
module.exports.TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
151
152
|
module.exports.BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
152
153
|
module.exports.BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
153
154
|
module.exports.BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
154
155
|
module.exports.BindingJsx = __napiModule.exports.BindingJsx
|
|
155
156
|
module.exports.BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
156
157
|
module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
158
|
+
module.exports.BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
159
|
+
module.exports.BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
157
160
|
module.exports.FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
161
|
+
module.exports.initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
158
162
|
module.exports.registerPlugins = __napiModule.exports.registerPlugins
|
|
159
163
|
module.exports.shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
160
164
|
module.exports.startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
Binary file
|
|
@@ -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-wK0CRIMb.mjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
|
|
@@ -150,7 +150,7 @@ interface PreRenderedAsset {
|
|
|
150
150
|
}
|
|
151
151
|
type AssetFileNamesFunction = (chunkInfo: PreRenderedAsset) => string;
|
|
152
152
|
type GlobalsFunction = (name: string) => string;
|
|
153
|
-
type MinifyOptions = Omit<MinifyOptions$1, "module" | "
|
|
153
|
+
type MinifyOptions = Omit<MinifyOptions$1, "module" | "sourcemap">;
|
|
154
154
|
interface ChunkingContext {
|
|
155
155
|
getModuleInfo(moduleId: string): ModuleInfo | null;
|
|
156
156
|
}
|
|
@@ -793,6 +793,8 @@ type TreeshakingOptions = {
|
|
|
793
793
|
manualPureFunctions?: readonly string[];
|
|
794
794
|
unknownGlobalSideEffects?: boolean;
|
|
795
795
|
commonjs?: boolean;
|
|
796
|
+
propertyReadSideEffects?: false | "always";
|
|
797
|
+
propertyWriteSideEffects?: false | "always";
|
|
796
798
|
};
|
|
797
799
|
//#endregion
|
|
798
800
|
//#region src/types/output-bundle.d.ts
|
|
@@ -817,11 +819,15 @@ type SourceMapInput = ExistingRawSourceMap | string | null;
|
|
|
817
819
|
declare const VERSION: string;
|
|
818
820
|
//#endregion
|
|
819
821
|
//#region src/builtin-plugin/utils.d.ts
|
|
822
|
+
declare const BuiltinClassSymbol: symbol;
|
|
820
823
|
declare class BuiltinPlugin {
|
|
821
824
|
name: BindingBuiltinPluginName;
|
|
822
825
|
_options?: unknown;
|
|
823
826
|
constructor(name: BindingBuiltinPluginName, _options?: unknown);
|
|
824
827
|
}
|
|
828
|
+
interface BuiltinPlugin {
|
|
829
|
+
[BuiltinClassSymbol]: boolean;
|
|
830
|
+
}
|
|
825
831
|
//#endregion
|
|
826
832
|
//#region src/constants/plugin.d.ts
|
|
827
833
|
declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
|
|
@@ -1070,6 +1076,7 @@ type HmrOptions = boolean | {
|
|
|
1070
1076
|
host?: string;
|
|
1071
1077
|
port?: number;
|
|
1072
1078
|
implement?: string;
|
|
1079
|
+
new?: boolean;
|
|
1073
1080
|
};
|
|
1074
1081
|
type OptimizationOptions = {
|
|
1075
1082
|
/**
|
|
@@ -1077,6 +1084,19 @@ type OptimizationOptions = {
|
|
|
1077
1084
|
*
|
|
1078
1085
|
* When enabled, constant values from imported modules will be inlined at their usage sites,
|
|
1079
1086
|
* potentially reducing bundle size and improving runtime performance by eliminating variable lookups.
|
|
1087
|
+
* **options**:
|
|
1088
|
+
* - `true`: equivalent to `{ mode: 'all', pass: 1 }`, enabling constant inlining for all eligible constants with a single pass.
|
|
1089
|
+
* - `false`: Disable constant inlining
|
|
1090
|
+
* - `{ mode: 'smart' | 'all', pass?: number }`:
|
|
1091
|
+
* - `mode: 'smart'`: Only inline constants in specific scenarios where it is likely to reduce bundle size and improve performance.
|
|
1092
|
+
* Smart mode inlines constants in these specific scenarios:
|
|
1093
|
+
* 1. `if (test) {} else {}` - condition expressions in if statements
|
|
1094
|
+
* 2. `test ? a : b` - condition expressions in ternary operators
|
|
1095
|
+
* 3. `test1 || test2` - logical OR expressions
|
|
1096
|
+
* 4. `test1 && test2` - logical AND expressions
|
|
1097
|
+
* 5. `test1 ?? test2` - nullish coalescing expressions
|
|
1098
|
+
* - `mode: 'all'`: Inline all imported constants wherever they are used.
|
|
1099
|
+
* - `pass`: Number of passes to perform for inlining constants.
|
|
1080
1100
|
*
|
|
1081
1101
|
* **example**
|
|
1082
1102
|
* ```js
|
|
@@ -1098,7 +1118,10 @@ type OptimizationOptions = {
|
|
|
1098
1118
|
*
|
|
1099
1119
|
* @default false
|
|
1100
1120
|
*/
|
|
1101
|
-
inlineConst?: boolean
|
|
1121
|
+
inlineConst?: boolean | {
|
|
1122
|
+
mode?: "all" | "smart";
|
|
1123
|
+
pass?: number;
|
|
1124
|
+
};
|
|
1102
1125
|
};
|
|
1103
1126
|
type AttachDebugOptions = "none" | "simple" | "full";
|
|
1104
1127
|
type ChunkModulesOrder = "exec-order" | "module-id";
|
|
@@ -1136,6 +1159,10 @@ interface InputOptions {
|
|
|
1136
1159
|
mainFiles?: string[];
|
|
1137
1160
|
modules?: string[];
|
|
1138
1161
|
symlinks?: boolean;
|
|
1162
|
+
/**
|
|
1163
|
+
* @deprecated Use the top-level `tsconfig` option instead.
|
|
1164
|
+
*/
|
|
1165
|
+
tsconfigFilename?: string;
|
|
1139
1166
|
};
|
|
1140
1167
|
cwd?: string;
|
|
1141
1168
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rolldown } from "./src-
|
|
1
|
+
import { rolldown } from "./src-Dc4fRARy.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { readdir } from "node:fs/promises";
|
|
@@ -28,9 +28,8 @@ async function bundleTsConfig(configFile, isEsm) {
|
|
|
28
28
|
transform: {
|
|
29
29
|
filter: { id: /\.[cm]?[jt]s$/ },
|
|
30
30
|
async handler(code, id) {
|
|
31
|
-
const injectValues = `const ${dirnameVarName} = ${JSON.stringify(path.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(id).href)};`;
|
|
32
31
|
return {
|
|
33
|
-
code:
|
|
32
|
+
code: `const ${dirnameVarName} = ${JSON.stringify(path.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(id).href)};` + code,
|
|
34
33
|
map: null
|
|
35
34
|
};
|
|
36
35
|
}
|
|
@@ -38,13 +37,12 @@ async function bundleTsConfig(configFile, isEsm) {
|
|
|
38
37
|
}]
|
|
39
38
|
});
|
|
40
39
|
const outputDir = path.dirname(configFile);
|
|
41
|
-
const
|
|
40
|
+
const fileName = (await bundle.write({
|
|
42
41
|
dir: outputDir,
|
|
43
42
|
format: isEsm ? "esm" : "cjs",
|
|
44
43
|
sourcemap: "inline",
|
|
45
44
|
entryFileNames: `rolldown.config.[hash]${path.extname(configFile).replace("ts", "js")}`
|
|
46
|
-
});
|
|
47
|
-
const fileName = result.output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
45
|
+
})).output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
48
46
|
return path.join(outputDir, fileName);
|
|
49
47
|
}
|
|
50
48
|
const SUPPORTED_JS_CONFIG_FORMATS = [
|
|
@@ -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.87.0/node_modules/oxc-parser/wrap.mjs
|
|
190
190
|
function wrap$1(result) {
|
|
191
191
|
let program, module, comments, errors;
|
|
192
192
|
return {
|
|
@@ -137,8 +137,7 @@ function requirePicocolors() {
|
|
|
137
137
|
picocolors.exports.createColors = createColors;
|
|
138
138
|
return picocolors.exports;
|
|
139
139
|
}
|
|
140
|
-
|
|
141
|
-
const e = /* @__PURE__ */ getDefaultExportFromCjs(picocolorsExports);
|
|
140
|
+
const e = /* @__PURE__ */ getDefaultExportFromCjs(/* @__PURE__ */ requirePicocolors());
|
|
142
141
|
function J({ onlyFirst: t = false } = {}) {
|
|
143
142
|
const F$1 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
144
143
|
return new RegExp(F$1, t ? void 0 : "g");
|
|
@@ -596,12 +595,10 @@ let wD = class extends x {
|
|
|
596
595
|
return this.options[this.cursor].value;
|
|
597
596
|
}
|
|
598
597
|
toggleAll() {
|
|
599
|
-
|
|
600
|
-
this.value = u$1 ? [] : this.options.map((F$1) => F$1.value);
|
|
598
|
+
this.value = this.value.length === this.options.length ? [] : this.options.map((F$1) => F$1.value);
|
|
601
599
|
}
|
|
602
600
|
toggleValue() {
|
|
603
|
-
|
|
604
|
-
this.value = u$1 ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
601
|
+
this.value = this.value.includes(this._value) ? this.value.filter((F$1) => F$1 !== this._value) : [...this.value, this._value];
|
|
605
602
|
}
|
|
606
603
|
};
|
|
607
604
|
var SD = Object.defineProperty, $D = (t, u$1, F$1) => u$1 in t ? SD(t, u$1, {
|
|
@@ -811,7 +808,7 @@ async function prompt(message, opts = {}) {
|
|
|
811
808
|
if (Error.captureStackTrace) Error.captureStackTrace(error, prompt);
|
|
812
809
|
throw error;
|
|
813
810
|
}
|
|
814
|
-
case "undefined": return
|
|
811
|
+
case "undefined": return;
|
|
815
812
|
case "null": return null;
|
|
816
813
|
case "symbol": return kCancel;
|
|
817
814
|
default:
|