@rolldown/browser 1.0.0-beta.59 → 1.0.0-beta.60
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 +32 -32
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +7 -7
- package/dist/{constructors-c0HHH7Qq.js → constructors-CPMzz58l.js} +2 -8
- package/dist/experimental-index.browser.mjs +4 -37
- package/dist/experimental-index.d.mts +5 -63
- package/dist/experimental-index.mjs +6 -39
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +1 -2
- package/dist/get-log-filter.d.mts +1 -1
- package/dist/index.browser.mjs +6 -6
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +11 -11
- package/dist/normalize-string-or-regex-DcX5TPjK.js +247 -0
- 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/plugins-index.browser.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -2
- package/dist/rolldown-binding.wasi-browser.js +0 -1
- package/dist/rolldown-binding.wasi.cjs +0 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-Bfw5c2c3.js → rolldown-build-Zb6e1FlF.js} +657 -78
- package/dist/shared/{binding-MAEzB4KA.d.mts → binding-CAB1xlCZ.d.mts} +58 -134
- package/dist/shared/{bindingify-input-options-BTd8uAdf.mjs → bindingify-input-options-C4xVxTKf.mjs} +600 -50
- package/dist/shared/{composable-filters-C5qA4jo-.mjs → composable-filters-DmVadxLf.mjs} +41 -20
- package/dist/shared/{constructors-CQP6o3cR.d.mts → constructors-D_KDVVwY.d.mts} +3 -5
- package/dist/shared/{constructors-C8tBnLHP.mjs → constructors-KqJrL3Ok.mjs} +2 -8
- package/dist/shared/{define-config-CpZLzJD0.d.mts → define-config-CUEbSpq4.d.mts} +954 -408
- package/dist/shared/{load-config-cKGxDu4K.mjs → load-config-DN8SQL2o.mjs} +1 -1
- package/dist/shared/{logging-B4x9qar8.d.mts → logging-DGAQcdLz.d.mts} +4 -0
- package/dist/shared/{logs-DEfpOy5A.mjs → logs-cXucB9vK.mjs} +8 -8
- package/dist/shared/normalize-string-or-regex-Bn5eoSii.mjs +60 -0
- package/dist/shared/{parse-ast-index-BLdgtc2B.mjs → parse-ast-index-B54CTqgh.mjs} +2 -2
- package/dist/shared/{prompt-CNt8OM9C.mjs → prompt-D80rO-gq.mjs} +220 -220
- package/dist/shared/{rolldown-8m9pjMU2.mjs → rolldown-BhEWsQWt.mjs} +1 -1
- package/dist/shared/{rolldown-build-DKF_S8hw.mjs → rolldown-build-PEQvqPGC.mjs} +46 -35
- package/dist/shared/{utils-BGxZdOXA.d.mts → utils-0UHbNgk4.d.mts} +2 -11
- package/dist/shared/{watch-BEzOq0zm.mjs → watch-avpeg13R.mjs} +11 -12
- package/package.json +1 -1
- package/dist/normalize-string-or-regex-BB1FWNyl.js +0 -872
- package/dist/shared/misc-BubmxcE3.mjs +0 -22
- package/dist/shared/normalize-string-or-regex-DJ5EwPtg.mjs +0 -669
- /package/dist/shared/{define-config-BF4P-Pum.mjs → define-config-DrUTwApf.mjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as PluginDriver, s as validateOption, t as RolldownBuild } from "./rolldown-build-
|
|
1
|
+
import { l as PluginDriver, s as validateOption, t as RolldownBuild } from "./rolldown-build-PEQvqPGC.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/api/rolldown/index.ts
|
|
4
4
|
/** @category Programmatic APIs */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as logInputHookInOutputPlugin, n as error } from "./logs-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { i as logInputHookInOutputPlugin, n as error } from "./logs-cXucB9vK.mjs";
|
|
2
|
+
import { n as BuiltinPlugin } from "./normalize-string-or-regex-Bn5eoSii.mjs";
|
|
3
|
+
import { S as VERSION, _ as LOG_LEVEL_DEBUG, b as LOG_LEVEL_WARN, c as transformToRollupOutput, d as transformAssetSource, f as lazyProp, g as normalizeLog, h as normalizeHook, i as transformModuleInfo, l as transformRenderedChunk, m as MinimalPluginContextImpl, p as PlainObjectLike, s as unwrapBindingResult, t as bindingifyInputOptions, u as __decorate, v as LOG_LEVEL_ERROR, x as logLevelPriority, y as LOG_LEVEL_INFO } from "./bindingify-input-options-C4xVxTKf.mjs";
|
|
4
|
+
import { v as unimplemented } from "./composable-filters-DmVadxLf.mjs";
|
|
5
5
|
import { Worker } from "node:worker_threads";
|
|
6
6
|
import { BindingBundler, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
7
7
|
import path from "node:path";
|
|
@@ -1603,22 +1603,23 @@ const WatchOptionsSchema = strictObject({
|
|
|
1603
1603
|
onInvalidate: pipe(optional(pipe(function_(), args(tuple([string()])))), description("An optional function that will be called immediately every time a module changes that is part of the build."))
|
|
1604
1604
|
});
|
|
1605
1605
|
const ChecksOptionsSchema = strictObject({
|
|
1606
|
-
circularDependency: pipe(optional(boolean()), description("Whether to emit
|
|
1607
|
-
eval: pipe(optional(boolean()), description("Whether to emit
|
|
1608
|
-
missingGlobalName: pipe(optional(boolean()), description("Whether to emit
|
|
1609
|
-
missingNameOptionForIifeExport: pipe(optional(boolean()), description("Whether to emit
|
|
1610
|
-
mixedExports: pipe(optional(boolean()), description("Whether to emit
|
|
1611
|
-
unresolvedEntry: pipe(optional(boolean()), description("Whether to emit
|
|
1612
|
-
unresolvedImport: pipe(optional(boolean()), description("Whether to emit
|
|
1613
|
-
filenameConflict: pipe(optional(boolean()), description("Whether to emit
|
|
1614
|
-
commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit
|
|
1615
|
-
importIsUndefined: pipe(optional(boolean()), description("Whether to emit
|
|
1616
|
-
emptyImportMeta: pipe(optional(boolean()), description("Whether to emit
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1606
|
+
circularDependency: pipe(optional(boolean()), description("Whether to emit warnings when detecting circular dependency")),
|
|
1607
|
+
eval: pipe(optional(boolean()), description("Whether to emit warnings when detecting uses of direct `eval`s")),
|
|
1608
|
+
missingGlobalName: pipe(optional(boolean()), description("Whether to emit warnings when the `output.globals` option is missing when needed")),
|
|
1609
|
+
missingNameOptionForIifeExport: pipe(optional(boolean()), description("Whether to emit warnings when the `output.name` option is missing when needed")),
|
|
1610
|
+
mixedExports: pipe(optional(boolean()), description("Whether to emit warnings when the way to export values is ambiguous")),
|
|
1611
|
+
unresolvedEntry: pipe(optional(boolean()), description("Whether to emit warnings when an entrypoint cannot be resolved")),
|
|
1612
|
+
unresolvedImport: pipe(optional(boolean()), description("Whether to emit warnings when an import cannot be resolved")),
|
|
1613
|
+
filenameConflict: pipe(optional(boolean()), description("Whether to emit warnings when files generated have the same name with different contents")),
|
|
1614
|
+
commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warnings when a CommonJS variable is used in an ES module")),
|
|
1615
|
+
importIsUndefined: pipe(optional(boolean()), description("Whether to emit warnings when an imported variable is not exported")),
|
|
1616
|
+
emptyImportMeta: pipe(optional(boolean()), description("Whether to emit warnings when `import.meta` is not supported with the output format and is replaced with an empty object (`{}`)")),
|
|
1617
|
+
toleratedTransform: pipe(optional(boolean()), description("Whether to emit warnings when detecting tolerated transform")),
|
|
1618
|
+
cannotCallNamespace: pipe(optional(boolean()), description("Whether to emit warnings when a namespace is called as a function")),
|
|
1619
|
+
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warnings when a config value is overridden by another config value with a higher priority")),
|
|
1620
|
+
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warnings when a plugin that is covered by a built-in feature is used")),
|
|
1621
|
+
couldNotCleanDirectory: pipe(optional(boolean()), description("Whether to emit warnings when Rolldown could not clean the output directory")),
|
|
1622
|
+
pluginTimings: pipe(optional(boolean()), description("Whether to emit warnings when plugins take significant time during the build process"))
|
|
1622
1623
|
});
|
|
1623
1624
|
const CompressOptionsKeepNamesSchema = strictObject({
|
|
1624
1625
|
function: boolean(),
|
|
@@ -1723,7 +1724,6 @@ const InputOptionsSchema = strictObject({
|
|
|
1723
1724
|
onwarn: optional(OnwarnSchema),
|
|
1724
1725
|
moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
|
|
1725
1726
|
experimental: optional(strictObject({
|
|
1726
|
-
disableLiveBindings: optional(boolean()),
|
|
1727
1727
|
enableComposingJsPlugins: optional(boolean()),
|
|
1728
1728
|
viteMode: optional(boolean()),
|
|
1729
1729
|
resolveNewUrlToAsset: optional(boolean()),
|
|
@@ -1754,7 +1754,7 @@ const InputOptionsSchema = strictObject({
|
|
|
1754
1754
|
literal("exports-only"),
|
|
1755
1755
|
literal(false)
|
|
1756
1756
|
]))),
|
|
1757
|
-
tsconfig: pipe(optional(union([
|
|
1757
|
+
tsconfig: pipe(optional(union([boolean(), string()])), description("Path to the tsconfig.json file."))
|
|
1758
1758
|
});
|
|
1759
1759
|
const InputCliOverrideSchema = strictObject({
|
|
1760
1760
|
input: pipe(optional(array(string())), description("Entry file")),
|
|
@@ -1879,6 +1879,7 @@ const OutputOptionsSchema = strictObject({
|
|
|
1879
1879
|
inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
|
|
1880
1880
|
dynamicImportInCjs: pipe(optional(boolean()), description("Dynamic import in CJS output")),
|
|
1881
1881
|
manualChunks: optional(ManualChunksFunctionSchema),
|
|
1882
|
+
codeSplitting: optional(AdvancedChunksSchema),
|
|
1882
1883
|
advancedChunks: optional(AdvancedChunksSchema),
|
|
1883
1884
|
legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
|
|
1884
1885
|
plugins: optional(custom(() => true)),
|
|
@@ -1910,10 +1911,14 @@ const OutputCliOverrideSchema = strictObject({
|
|
|
1910
1911
|
outro: pipe(optional(string()), description(getAddonDescription("bottom", "inside"))),
|
|
1911
1912
|
esModule: pipe(optional(boolean()), description("Always generate `__esModule` marks in non-ESM formats, defaults to `if-default-prop` (use `--no-esModule` to always disable)")),
|
|
1912
1913
|
globals: pipe(optional(record(string(), string())), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
|
|
1914
|
+
codeSplitting: pipe(optional(strictObject({
|
|
1915
|
+
minSize: pipe(optional(number()), description("Minimum size of the chunk")),
|
|
1916
|
+
minShareCount: pipe(optional(number()), description("Minimum share count of the chunk"))
|
|
1917
|
+
})), description("Code splitting options")),
|
|
1913
1918
|
advancedChunks: pipe(optional(strictObject({
|
|
1914
1919
|
minSize: pipe(optional(number()), description("Minimum size of the chunk")),
|
|
1915
1920
|
minShareCount: pipe(optional(number()), description("Minimum share count of the chunk"))
|
|
1916
|
-
})), description("
|
|
1921
|
+
})), description("Deprecated: use codeSplitting instead")),
|
|
1917
1922
|
minify: pipe(optional(boolean()), description("Minify the bundled file"))
|
|
1918
1923
|
});
|
|
1919
1924
|
const OutputCliOptionsSchema = omit(strictObject({
|
|
@@ -2025,7 +2030,7 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
2025
2030
|
if (outputOptions.inlineDynamicImports === true) {
|
|
2026
2031
|
if (manualChunks != null) throw new Error("Invalid value \"true\" for option \"output.inlineDynamicImports\" - this option is not supported for \"output.manualChunks\".");
|
|
2027
2032
|
}
|
|
2028
|
-
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
2033
|
+
const advancedChunks = bindingifyAdvancedChunks(outputOptions.codeSplitting, outputOptions.advancedChunks, manualChunks);
|
|
2029
2034
|
return {
|
|
2030
2035
|
dir,
|
|
2031
2036
|
file: file == null ? void 0 : file,
|
|
@@ -2059,7 +2064,7 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
2059
2064
|
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
2060
2065
|
inlineDynamicImports: outputOptions.inlineDynamicImports,
|
|
2061
2066
|
dynamicImportInCjs: outputOptions.dynamicImportInCjs,
|
|
2062
|
-
advancedChunks,
|
|
2067
|
+
manualCodeSplitting: advancedChunks,
|
|
2063
2068
|
polyfillRequire: outputOptions.polyfillRequire,
|
|
2064
2069
|
sanitizeFileName,
|
|
2065
2070
|
preserveModules,
|
|
@@ -2112,15 +2117,21 @@ function bindingifyAssetFilenames(assetFileNames) {
|
|
|
2112
2117
|
};
|
|
2113
2118
|
return assetFileNames;
|
|
2114
2119
|
}
|
|
2115
|
-
function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
|
|
2116
|
-
|
|
2117
|
-
|
|
2120
|
+
function bindingifyAdvancedChunks(codeSplitting, advancedChunks, manualChunks) {
|
|
2121
|
+
let effectiveOption = codeSplitting;
|
|
2122
|
+
if (codeSplitting != null && advancedChunks != null) console.warn("`advancedChunks` option is ignored due to `codeSplitting` option is specified.");
|
|
2123
|
+
else if (codeSplitting == null && advancedChunks != null) {
|
|
2124
|
+
console.warn("`advancedChunks` option is deprecated, please use `codeSplitting` instead.");
|
|
2125
|
+
effectiveOption = advancedChunks;
|
|
2126
|
+
}
|
|
2127
|
+
if (manualChunks != null && effectiveOption != null) console.warn("`manualChunks` option is ignored due to `codeSplitting` option is specified.");
|
|
2128
|
+
else if (manualChunks != null) effectiveOption = { groups: [{ name(moduleId, ctx) {
|
|
2118
2129
|
return manualChunks(moduleId, { getModuleInfo: (id) => ctx.getModuleInfo(id) });
|
|
2119
2130
|
} }] };
|
|
2120
|
-
if (
|
|
2121
|
-
const { groups, ...
|
|
2131
|
+
if (effectiveOption == null) return;
|
|
2132
|
+
const { groups, ...restOptions } = effectiveOption;
|
|
2122
2133
|
return {
|
|
2123
|
-
...
|
|
2134
|
+
...restOptions,
|
|
2124
2135
|
groups: groups?.map((group) => {
|
|
2125
2136
|
const { name, ...restGroup } = group;
|
|
2126
2137
|
return {
|
|
@@ -2183,14 +2194,14 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
|
|
|
2183
2194
|
}
|
|
2184
2195
|
}
|
|
2185
2196
|
const availableParallelism = () => {
|
|
2186
|
-
let availableParallelism
|
|
2197
|
+
let availableParallelism = 1;
|
|
2187
2198
|
try {
|
|
2188
|
-
availableParallelism
|
|
2199
|
+
availableParallelism = os.availableParallelism();
|
|
2189
2200
|
} catch {
|
|
2190
2201
|
const cpus = os.cpus();
|
|
2191
|
-
if (Array.isArray(cpus) && cpus.length > 0) availableParallelism
|
|
2202
|
+
if (Array.isArray(cpus) && cpus.length > 0) availableParallelism = cpus.length;
|
|
2192
2203
|
}
|
|
2193
|
-
return Math.min(availableParallelism
|
|
2204
|
+
return Math.min(availableParallelism, 8);
|
|
2194
2205
|
};
|
|
2195
2206
|
|
|
2196
2207
|
//#endregion
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BindingBuiltinPluginName } from "./binding-MAEzB4KA.mjs";
|
|
1
|
+
import { t as BindingBuiltinPluginName } from "./binding-CAB1xlCZ.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/types/utils.d.ts
|
|
5
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -9,14 +8,6 @@ type MakeAsync<Function_> = Function_ extends ((this: infer This, ...parameters:
|
|
|
9
8
|
type MaybeArray<T> = T | T[];
|
|
10
9
|
type StringOrRegExp = string | RegExp;
|
|
11
10
|
//#endregion
|
|
12
|
-
//#region src/log/log-handler.d.ts
|
|
13
|
-
type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
|
|
14
|
-
type LoggingFunctionWithPosition = (log: RollupLog | string | (() => RollupLog | string), pos?: number | {
|
|
15
|
-
column: number;
|
|
16
|
-
line: number;
|
|
17
|
-
}) => void;
|
|
18
|
-
type WarningHandlerWithDefault = (warning: RollupLog, defaultHandler: LoggingFunction) => void;
|
|
19
|
-
//#endregion
|
|
20
11
|
//#region src/builtin-plugin/utils.d.ts
|
|
21
12
|
declare class BuiltinPlugin {
|
|
22
13
|
name: BindingBuiltinPluginName;
|
|
@@ -26,4 +17,4 @@ declare class BuiltinPlugin {
|
|
|
26
17
|
constructor(name: BindingBuiltinPluginName, _options?: unknown);
|
|
27
18
|
}
|
|
28
19
|
//#endregion
|
|
29
|
-
export {
|
|
20
|
+
export { NullValue as a, MaybePromise as i, MakeAsync as n, PartialNull as o, MaybeArray as r, StringOrRegExp as s, BuiltinPlugin as t };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { o as logMultiplyNotifyOption } from "./logs-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-
|
|
5
|
-
import { a as aggregateBindingErrorsIntoJsError } from "./bindingify-input-options-BTd8uAdf.mjs";
|
|
1
|
+
import { o as logMultiplyNotifyOption } from "./logs-cXucB9vK.mjs";
|
|
2
|
+
import { a as aggregateBindingErrorsIntoJsError, b as LOG_LEVEL_WARN } from "./bindingify-input-options-C4xVxTKf.mjs";
|
|
3
|
+
import { h as arraify } from "./composable-filters-DmVadxLf.mjs";
|
|
4
|
+
import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-PEQvqPGC.mjs";
|
|
6
5
|
import { BindingWatcher, shutdownAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
7
6
|
|
|
8
7
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
@@ -39,7 +38,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
|
|
|
39
38
|
|
|
40
39
|
//#endregion
|
|
41
40
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
42
|
-
const processOk = (process
|
|
41
|
+
const processOk = (process) => !!process && typeof process === "object" && typeof process.removeListener === "function" && typeof process.emit === "function" && typeof process.reallyExit === "function" && typeof process.listeners === "function" && typeof process.kill === "function" && typeof process.pid === "number" && typeof process.on === "function";
|
|
43
42
|
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
44
43
|
const global = globalThis;
|
|
45
44
|
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
@@ -115,15 +114,15 @@ var SignalExit = class extends SignalExitBase {
|
|
|
115
114
|
#originalProcessReallyExit;
|
|
116
115
|
#sigListeners = {};
|
|
117
116
|
#loaded = false;
|
|
118
|
-
constructor(process
|
|
117
|
+
constructor(process) {
|
|
119
118
|
super();
|
|
120
|
-
this.#process = process
|
|
119
|
+
this.#process = process;
|
|
121
120
|
this.#sigListeners = {};
|
|
122
121
|
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
123
122
|
const listeners = this.#process.listeners(sig);
|
|
124
123
|
let { count } = this.#emitter;
|
|
125
124
|
/* c8 ignore start */
|
|
126
|
-
const p = process
|
|
125
|
+
const p = process;
|
|
127
126
|
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
|
|
128
127
|
/* c8 ignore stop */
|
|
129
128
|
if (listeners.length === count) {
|
|
@@ -131,11 +130,11 @@ var SignalExit = class extends SignalExitBase {
|
|
|
131
130
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
132
131
|
/* c8 ignore start */
|
|
133
132
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
134
|
-
if (!ret) process
|
|
133
|
+
if (!ret) process.kill(process.pid, s);
|
|
135
134
|
}
|
|
136
135
|
};
|
|
137
|
-
this.#originalProcessReallyExit = process
|
|
138
|
-
this.#originalProcessEmit = process
|
|
136
|
+
this.#originalProcessReallyExit = process.reallyExit;
|
|
137
|
+
this.#originalProcessEmit = process.emit;
|
|
139
138
|
}
|
|
140
139
|
onExit(cb, opts) {
|
|
141
140
|
/* c8 ignore start */
|