rolldown 1.0.0-beta.42 → 1.0.0-beta.44
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/bin/cli.mjs +1 -0
- package/dist/cli-setup.d.mts +1 -0
- package/dist/cli-setup.mjs +16 -0
- package/dist/cli.mjs +1047 -68
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +5 -4
- package/dist/experimental-index.d.mts +26 -5
- package/dist/experimental-index.mjs +56 -15
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +5 -4
- package/dist/parallel-plugin-worker.mjs +4 -3
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -1
- package/dist/shared/{parse-ast-index-DHblAIjN.mjs → binding-DkR1uPxc.mjs} +102 -366
- package/dist/shared/{binding-CtbNz6TD.d.mts → binding-QBosa6N8.d.mts} +108 -17
- package/dist/shared/{define-config-C9Rp3knL.d.mts → define-config-D9LwN_tW.d.mts} +250 -87
- package/dist/shared/{load-config-a7bPxI7K.mjs → load-config-BwIN-FIB.mjs} +2 -2
- package/dist/shared/{misc-CQeo-AFx.mjs → misc-usdOVIou.mjs} +1 -1
- package/dist/shared/parse-ast-index-Dee9Dv5S.mjs +297 -0
- package/dist/shared/{prompt-B4e-jZUR.mjs → prompt-YGfbLmz5.mjs} +1 -1
- package/dist/shared/{src-CUdyD4rb.mjs → src-DY4_vVWu.mjs} +137 -94
- package/package.json +19 -20
- package/dist/shared/logger-B83ocDok.mjs +0 -985
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { C as startAsyncRuntime, S as shutdownAsyncRuntime, c as BindingPluginOrder, f as BindingWatcher, g as initTraceSubscriber, i as BindingChunkModuleOrderBy, l as BindingPropertyReadSideEffects, n as BindingBundler, o as BindingLogLevel, p as ParallelJsPluginRegistry, r as BindingCallableBuiltinPlugin, s as BindingMagicString, t as BindingAttachDebugInfo, u as BindingPropertyWriteSideEffects } from "./binding-DkR1uPxc.mjs";
|
|
2
|
+
import { a as logCycleLoading, c as logDeprecatedInject, d as logInputHookInOutputPlugin, f as logInvalidLogPosition, h as styleText, i as error, l as logDeprecatedKeepNames, m as logPluginError, o as logDeprecatedDefine, p as logMultiplyNotifyOption, r as augmentCodeLocation, s as logDeprecatedDropLabels, t as parseAst, u as logDeprecatedProfilerNames } from "./parse-ast-index-Dee9Dv5S.mjs";
|
|
3
|
+
import { a as unreachable, i as unimplemented, o as unsupported, r as noop, t as arraify } from "./misc-usdOVIou.mjs";
|
|
3
4
|
import { Worker, isMainThread } from "node:worker_threads";
|
|
4
5
|
import path from "node:path";
|
|
5
|
-
import colors from "ansis";
|
|
6
6
|
import * as filter from "@rolldown/pluginutils";
|
|
7
7
|
import fsp from "node:fs/promises";
|
|
8
8
|
import os from "node:os";
|
|
@@ -218,7 +218,7 @@ if (isMainThread) {
|
|
|
218
218
|
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region package.json
|
|
221
|
-
var version = "1.0.0-beta.
|
|
221
|
+
var version = "1.0.0-beta.44";
|
|
222
222
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
223
223
|
|
|
224
224
|
//#endregion
|
|
@@ -1679,17 +1679,6 @@ const JsxOptionsSchema = strictObject({
|
|
|
1679
1679
|
pragmaFrag: pipe(optional(string()), description("Jsx fragment transformation")),
|
|
1680
1680
|
refresh: pipe(optional(boolean()), description("Enable react fast refresh"))
|
|
1681
1681
|
});
|
|
1682
|
-
const RollupJsxOptionsSchema = strictObject({
|
|
1683
|
-
mode: optional(union([
|
|
1684
|
-
literal("classic"),
|
|
1685
|
-
literal("automatic"),
|
|
1686
|
-
literal("preserve")
|
|
1687
|
-
])),
|
|
1688
|
-
factory: optional(string()),
|
|
1689
|
-
fragment: optional(string()),
|
|
1690
|
-
importSource: optional(string()),
|
|
1691
|
-
jsxImportSource: optional(string())
|
|
1692
|
-
});
|
|
1693
1682
|
const HelperModeSchema = union([literal("Runtime"), literal("External")]);
|
|
1694
1683
|
const DecoratorOptionSchema = object({
|
|
1695
1684
|
legacy: optional(boolean()),
|
|
@@ -1726,7 +1715,10 @@ const TransformOptionsSchema = object({
|
|
|
1726
1715
|
helpers: optional(HelpersSchema),
|
|
1727
1716
|
decorators: optional(DecoratorOptionSchema),
|
|
1728
1717
|
jsx: optional(union([literal("preserve"), JsxOptionsSchema])),
|
|
1729
|
-
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment"))
|
|
1718
|
+
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
|
|
1719
|
+
define: optional(record(string(), string())),
|
|
1720
|
+
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
1721
|
+
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names"))
|
|
1730
1722
|
});
|
|
1731
1723
|
const WatchOptionsSchema = strictObject({
|
|
1732
1724
|
chokidar: optional(never(`The "watch.chokidar" option is deprecated, please use "watch.notify" instead of it`)),
|
|
@@ -1853,11 +1845,11 @@ const InputOptionsSchema = strictObject({
|
|
|
1853
1845
|
literal("browser"),
|
|
1854
1846
|
literal("neutral"),
|
|
1855
1847
|
literal("node")
|
|
1856
|
-
])), description(`Platform for which the code should be generated (node, ${
|
|
1848
|
+
])), description(`Platform for which the code should be generated (node, ${styleText("underline", "browser")}, neutral)`)),
|
|
1857
1849
|
shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
|
|
1858
1850
|
treeshake: optional(TreeshakingOptionsSchema),
|
|
1859
1851
|
optimization: optional(OptimizationOptionsSchema),
|
|
1860
|
-
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${
|
|
1852
|
+
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${styleText("dim", "silent")}, ${styleText(["underline", "gray"], "info")}, debug, ${styleText("yellow", "warn")})`)),
|
|
1861
1853
|
onLog: optional(OnLogSchema),
|
|
1862
1854
|
onwarn: optional(OnwarnSchema),
|
|
1863
1855
|
moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
|
|
@@ -1879,18 +1871,12 @@ const InputOptionsSchema = strictObject({
|
|
|
1879
1871
|
chunkImportMap: optional(union([boolean(), object({
|
|
1880
1872
|
baseUrl: optional(string()),
|
|
1881
1873
|
fileName: optional(string())
|
|
1882
|
-
})]))
|
|
1874
|
+
})])),
|
|
1875
|
+
nativeMagicString: optional(boolean())
|
|
1883
1876
|
})),
|
|
1884
1877
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
1885
1878
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
1886
1879
|
profilerNames: optional(boolean()),
|
|
1887
|
-
jsx: optional(union([
|
|
1888
|
-
literal(false),
|
|
1889
|
-
literal("react"),
|
|
1890
|
-
literal("react-jsx"),
|
|
1891
|
-
literal("preserve"),
|
|
1892
|
-
RollupJsxOptionsSchema
|
|
1893
|
-
])),
|
|
1894
1880
|
transform: optional(TransformOptionsSchema),
|
|
1895
1881
|
watch: optional(union([WatchOptionsSchema, literal(false)])),
|
|
1896
1882
|
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
|
|
@@ -1911,12 +1897,6 @@ const InputCliOverrideSchema = strictObject({
|
|
|
1911
1897
|
inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
|
|
1912
1898
|
treeshake: pipe(optional(boolean()), description("enable treeshaking")),
|
|
1913
1899
|
makeAbsoluteExternalsRelative: pipe(optional(boolean()), description("Prevent normalization of external imports")),
|
|
1914
|
-
jsx: pipe(optional(union([
|
|
1915
|
-
literal(false),
|
|
1916
|
-
literal("react"),
|
|
1917
|
-
literal("react-jsx"),
|
|
1918
|
-
literal("preserve")
|
|
1919
|
-
])), description("Jsx options preset")),
|
|
1920
1900
|
preserveEntrySignatures: pipe(optional(literal(false)), description("Avoid facade chunks for entry points")),
|
|
1921
1901
|
context: pipe(optional(string()), description("The entity top-level `this` represents."))
|
|
1922
1902
|
});
|
|
@@ -1946,6 +1926,7 @@ const ChunkFileNamesSchema = union([string(), pipe(function_(), args(tuple([cust
|
|
|
1946
1926
|
const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([custom(() => true)])), returns(string()))]);
|
|
1947
1927
|
const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
|
|
1948
1928
|
const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
|
|
1929
|
+
const PathsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
|
|
1949
1930
|
const AdvancedChunksSchema = strictObject({
|
|
1950
1931
|
includeDependenciesRecursively: optional(boolean()),
|
|
1951
1932
|
minSize: optional(number()),
|
|
@@ -1971,7 +1952,8 @@ const AdvancedChunksSchema = strictObject({
|
|
|
1971
1952
|
const GeneratedCodePresetSchema = union([literal("es5"), literal("es2015")]);
|
|
1972
1953
|
const GeneratedCodeOptionsSchema = strictObject({
|
|
1973
1954
|
symbols: pipe(optional(boolean()), description("Whether to use Symbol.toStringTag for namespace objects")),
|
|
1974
|
-
preset: GeneratedCodePresetSchema
|
|
1955
|
+
preset: GeneratedCodePresetSchema,
|
|
1956
|
+
profilerNames: pipe(optional(boolean()), description("Whether to add readable names to internal variables for profiling purposes"))
|
|
1975
1957
|
});
|
|
1976
1958
|
const OutputOptionsSchema = strictObject({
|
|
1977
1959
|
dir: pipe(optional(string()), description("Output directory, defaults to `dist` if `file` is not set")),
|
|
@@ -1981,18 +1963,18 @@ const OutputOptionsSchema = strictObject({
|
|
|
1981
1963
|
literal("named"),
|
|
1982
1964
|
literal("default"),
|
|
1983
1965
|
literal("none")
|
|
1984
|
-
])), description(`Specify a export mode (${
|
|
1966
|
+
])), description(`Specify a export mode (${styleText("underline", "auto")}, named, default, none)`)),
|
|
1985
1967
|
hashCharacters: pipe(optional(union([
|
|
1986
1968
|
literal("base64"),
|
|
1987
1969
|
literal("base36"),
|
|
1988
1970
|
literal("hex")
|
|
1989
1971
|
])), description("Use the specified character set for file hashes")),
|
|
1990
|
-
format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${
|
|
1972
|
+
format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${styleText("underline", "esm")}, cjs, and iife)`)),
|
|
1991
1973
|
sourcemap: pipe(optional(union([
|
|
1992
1974
|
boolean(),
|
|
1993
1975
|
literal("inline"),
|
|
1994
1976
|
literal("hidden")
|
|
1995
|
-
])), description(`Generate sourcemap (\`-s inline\` for inline, or ${
|
|
1977
|
+
])), description(`Generate sourcemap (\`-s inline\` for inline, or ${styleText("bold", "pass the `-s` on the last argument if you want to generate `.map` file")})`)),
|
|
1996
1978
|
sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
|
|
1997
1979
|
sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
|
|
1998
1980
|
sourcemapIgnoreList: optional(union([
|
|
@@ -2020,6 +2002,7 @@ const OutputOptionsSchema = strictObject({
|
|
|
2020
2002
|
])), description("Minify the bundled file")),
|
|
2021
2003
|
name: pipe(optional(string()), description("Name for UMD / IIFE format outputs")),
|
|
2022
2004
|
globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
|
|
2005
|
+
paths: pipe(optional(union([record(string(), string()), PathsFunctionSchema])), description("Maps external module IDs to paths")),
|
|
2023
2006
|
generatedCode: pipe(optional(partial(GeneratedCodeOptionsSchema)), description("Generated code options")),
|
|
2024
2007
|
externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
|
|
2025
2008
|
inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
|
|
@@ -2036,10 +2019,12 @@ const OutputOptionsSchema = strictObject({
|
|
|
2036
2019
|
preserveModulesRoot: pipe(optional(string()), description("Put preserved modules under this path at root level")),
|
|
2037
2020
|
virtualDirname: optional(string()),
|
|
2038
2021
|
minifyInternalExports: pipe(optional(boolean()), description("Minify internal exports")),
|
|
2039
|
-
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`."))
|
|
2022
|
+
topLevelVar: pipe(optional(boolean()), description("Rewrite top-level declarations to use `var`.")),
|
|
2023
|
+
cleanDir: pipe(optional(boolean()), description("Clean output directory before emitting output")),
|
|
2024
|
+
keepNames: pipe(optional(boolean()), description("Keep function and class names after bundling"))
|
|
2040
2025
|
});
|
|
2041
2026
|
const getAddonDescription = (placement, wrapper) => {
|
|
2042
|
-
return `Code to insert the ${
|
|
2027
|
+
return `Code to insert the ${styleText("bold", placement)} of the bundled file (${styleText("bold", wrapper)} the wrapper function)`;
|
|
2043
2028
|
};
|
|
2044
2029
|
const OutputCliOverrideSchema = strictObject({
|
|
2045
2030
|
assetFileNames: pipe(optional(string()), description("Name pattern for asset files")),
|
|
@@ -2144,6 +2129,10 @@ function unwrapBindingResult(container) {
|
|
|
2144
2129
|
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) throw aggregateBindingErrorsIntoJsError(container.errors);
|
|
2145
2130
|
return container;
|
|
2146
2131
|
}
|
|
2132
|
+
function normalizeBindingResult(container) {
|
|
2133
|
+
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) return aggregateBindingErrorsIntoJsError(container.errors);
|
|
2134
|
+
return container;
|
|
2135
|
+
}
|
|
2147
2136
|
function normalizeBindingError(e$1) {
|
|
2148
2137
|
return e$1.type === "JsError" ? e$1.field0 : Object.assign(/* @__PURE__ */ new Error(), {
|
|
2149
2138
|
kind: e$1.field0.kind,
|
|
@@ -2468,7 +2457,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2468
2457
|
this.data.updateModuleOption(id, rawOptions);
|
|
2469
2458
|
let loadPromise = this.data.loadModulePromiseMap.get(id);
|
|
2470
2459
|
if (!loadPromise) {
|
|
2471
|
-
loadPromise = this.context.load(id, options.moduleSideEffects ?? void 0).catch(() => {
|
|
2460
|
+
loadPromise = this.context.load(id, options.moduleSideEffects ?? void 0, options.packageJsonPath ?? void 0).catch(() => {
|
|
2472
2461
|
this.data.loadModulePromiseMap.delete(id);
|
|
2473
2462
|
});
|
|
2474
2463
|
this.data.loadModulePromiseMap.set(id, loadPromise);
|
|
@@ -2570,6 +2559,9 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
2570
2559
|
addWatchFile(id) {
|
|
2571
2560
|
this.inner.addWatchFile(id);
|
|
2572
2561
|
}
|
|
2562
|
+
sendMagicString(s) {
|
|
2563
|
+
this.inner.sendMagicString(s);
|
|
2564
|
+
}
|
|
2573
2565
|
};
|
|
2574
2566
|
|
|
2575
2567
|
//#endregion
|
|
@@ -2669,7 +2661,29 @@ function bindingifyTransform(args$1) {
|
|
|
2669
2661
|
const { handler, meta, options } = normalizeHook(hook);
|
|
2670
2662
|
return {
|
|
2671
2663
|
plugin: async (ctx, code, id, meta$1) => {
|
|
2672
|
-
|
|
2664
|
+
Object.defineProperties(meta$1, {
|
|
2665
|
+
magicString: { get() {
|
|
2666
|
+
return new BindingMagicString(code);
|
|
2667
|
+
} },
|
|
2668
|
+
ast: { get() {
|
|
2669
|
+
let lang = "js";
|
|
2670
|
+
switch (meta$1.moduleType) {
|
|
2671
|
+
case "js":
|
|
2672
|
+
case "jsx":
|
|
2673
|
+
case "ts":
|
|
2674
|
+
case "tsx":
|
|
2675
|
+
lang = meta$1.moduleType;
|
|
2676
|
+
break;
|
|
2677
|
+
default: break;
|
|
2678
|
+
}
|
|
2679
|
+
return parseAst(code, {
|
|
2680
|
+
astType: meta$1.moduleType.includes("ts") ? "ts" : "js",
|
|
2681
|
+
lang
|
|
2682
|
+
});
|
|
2683
|
+
} }
|
|
2684
|
+
});
|
|
2685
|
+
const transformCtx = new TransformPluginContextImpl(args$1.outputOptions, ctx.inner(), args$1.plugin, args$1.pluginContextData, ctx, id, code, args$1.onLog, args$1.logLevel, args$1.watchMode);
|
|
2686
|
+
const ret = await handler.call(transformCtx, code, id, meta$1);
|
|
2673
2687
|
if (ret == null) return;
|
|
2674
2688
|
if (typeof ret === "string") return { code: ret };
|
|
2675
2689
|
let moduleOption = args$1.pluginContextData.updateModuleOption(id, {
|
|
@@ -2677,9 +2691,18 @@ function bindingifyTransform(args$1) {
|
|
|
2677
2691
|
moduleSideEffects: ret.moduleSideEffects ?? null,
|
|
2678
2692
|
invalidate: false
|
|
2679
2693
|
});
|
|
2694
|
+
let normalizedCode = void 0;
|
|
2695
|
+
let map = ret.map;
|
|
2696
|
+
if (typeof ret.code === "string") normalizedCode = ret.code;
|
|
2697
|
+
else if (ret.code instanceof BindingMagicString) {
|
|
2698
|
+
let magicString = ret.code;
|
|
2699
|
+
normalizedCode = magicString.toString();
|
|
2700
|
+
let fallbackSourcemap = ctx.sendMagicString(magicString);
|
|
2701
|
+
if (fallbackSourcemap != void 0) map = fallbackSourcemap;
|
|
2702
|
+
}
|
|
2680
2703
|
return {
|
|
2681
|
-
code:
|
|
2682
|
-
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code,
|
|
2704
|
+
code: normalizedCode,
|
|
2705
|
+
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code, map)),
|
|
2683
2706
|
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
|
|
2684
2707
|
moduleType: ret.moduleType
|
|
2685
2708
|
};
|
|
@@ -3407,6 +3430,9 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3407
3430
|
get globals() {
|
|
3408
3431
|
return this.inner.globals || this.outputOptions.globals;
|
|
3409
3432
|
}
|
|
3433
|
+
get paths() {
|
|
3434
|
+
return this.outputOptions.paths;
|
|
3435
|
+
}
|
|
3410
3436
|
get hashCharacters() {
|
|
3411
3437
|
return this.inner.hashCharacters;
|
|
3412
3438
|
}
|
|
@@ -3566,6 +3592,49 @@ function isReadonlyArray(input) {
|
|
|
3566
3592
|
return Array.isArray(input);
|
|
3567
3593
|
}
|
|
3568
3594
|
|
|
3595
|
+
//#endregion
|
|
3596
|
+
//#region src/utils/normalize-transform-options.ts
|
|
3597
|
+
/**
|
|
3598
|
+
* Normalizes transform options by extracting `define`, `inject`, and `dropLabels` separately from OXC transform options.
|
|
3599
|
+
*
|
|
3600
|
+
* Prioritizes values from `transform.define`, `transform.inject`, and `transform.dropLabels` over deprecated top-level options.
|
|
3601
|
+
*/
|
|
3602
|
+
function normalizeTransformOptions(inputOptions, onLog) {
|
|
3603
|
+
const transform = inputOptions.transform;
|
|
3604
|
+
let define;
|
|
3605
|
+
if (transform?.define) define = Object.entries(transform.define);
|
|
3606
|
+
else if (inputOptions.define) {
|
|
3607
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedDefine());
|
|
3608
|
+
define = Object.entries(inputOptions.define);
|
|
3609
|
+
}
|
|
3610
|
+
let inject;
|
|
3611
|
+
if (transform?.inject) inject = transform.inject;
|
|
3612
|
+
else if (inputOptions.inject) {
|
|
3613
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedInject());
|
|
3614
|
+
inject = inputOptions.inject;
|
|
3615
|
+
}
|
|
3616
|
+
let dropLabels;
|
|
3617
|
+
if (transform?.dropLabels) dropLabels = transform.dropLabels;
|
|
3618
|
+
else if (inputOptions.dropLabels) {
|
|
3619
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedDropLabels());
|
|
3620
|
+
dropLabels = inputOptions.dropLabels;
|
|
3621
|
+
}
|
|
3622
|
+
let oxcTransformOptions;
|
|
3623
|
+
if (transform) {
|
|
3624
|
+
const { define: _define, inject: _inject, dropLabels: _dropLabels,...rest } = transform;
|
|
3625
|
+
if (Object.keys(rest).length > 0) {
|
|
3626
|
+
if (rest.jsx === false) rest.jsx = "disable";
|
|
3627
|
+
oxcTransformOptions = rest;
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
return {
|
|
3631
|
+
define,
|
|
3632
|
+
inject,
|
|
3633
|
+
dropLabels,
|
|
3634
|
+
oxcTransformOptions
|
|
3635
|
+
};
|
|
3636
|
+
}
|
|
3637
|
+
|
|
3569
3638
|
//#endregion
|
|
3570
3639
|
//#region src/utils/bindingify-input-options.ts
|
|
3571
3640
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -3575,7 +3644,19 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3575
3644
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
3576
3645
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3577
3646
|
});
|
|
3578
|
-
const
|
|
3647
|
+
const normalizedTransform = normalizeTransformOptions(inputOptions, onLog);
|
|
3648
|
+
let profilerNames;
|
|
3649
|
+
if (outputOptions.generatedCode?.profilerNames !== void 0) profilerNames = outputOptions.generatedCode.profilerNames;
|
|
3650
|
+
else if (inputOptions.profilerNames !== void 0) {
|
|
3651
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedProfilerNames());
|
|
3652
|
+
profilerNames = inputOptions.profilerNames;
|
|
3653
|
+
}
|
|
3654
|
+
let keepNames;
|
|
3655
|
+
if (outputOptions.keepNames !== void 0) keepNames = outputOptions.keepNames;
|
|
3656
|
+
else if (inputOptions.keepNames !== void 0) {
|
|
3657
|
+
onLog(LOG_LEVEL_WARN, logDeprecatedKeepNames());
|
|
3658
|
+
keepNames = inputOptions.keepNames;
|
|
3659
|
+
}
|
|
3579
3660
|
return {
|
|
3580
3661
|
input: bindingifyInput(inputOptions.input),
|
|
3581
3662
|
plugins,
|
|
@@ -3588,15 +3669,14 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3588
3669
|
onLog: async (level, log) => onLog(level, log),
|
|
3589
3670
|
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
|
|
3590
3671
|
moduleTypes: inputOptions.moduleTypes,
|
|
3591
|
-
define:
|
|
3592
|
-
inject: bindingifyInject(
|
|
3672
|
+
define: normalizedTransform.define,
|
|
3673
|
+
inject: bindingifyInject(normalizedTransform.inject),
|
|
3593
3674
|
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
3594
|
-
profilerNames
|
|
3595
|
-
|
|
3596
|
-
transform,
|
|
3675
|
+
profilerNames,
|
|
3676
|
+
transform: normalizedTransform.oxcTransformOptions,
|
|
3597
3677
|
watch: bindingifyWatch(inputOptions.watch),
|
|
3598
|
-
dropLabels:
|
|
3599
|
-
keepNames
|
|
3678
|
+
dropLabels: normalizedTransform.dropLabels,
|
|
3679
|
+
keepNames,
|
|
3600
3680
|
checks: inputOptions.checks,
|
|
3601
3681
|
deferSyncScanData: () => {
|
|
3602
3682
|
let ret = [];
|
|
@@ -3661,7 +3741,8 @@ function bindingifyExperimental(experimental) {
|
|
|
3661
3741
|
chunkModulesOrder,
|
|
3662
3742
|
chunkImportMap: experimental?.chunkImportMap,
|
|
3663
3743
|
onDemandWrapping: experimental?.onDemandWrapping,
|
|
3664
|
-
incrementalBuild: experimental?.incrementalBuild
|
|
3744
|
+
incrementalBuild: experimental?.incrementalBuild,
|
|
3745
|
+
nativeMagicString: experimental?.nativeMagicString
|
|
3665
3746
|
};
|
|
3666
3747
|
}
|
|
3667
3748
|
function bindingifyResolve(resolve) {
|
|
@@ -3724,46 +3805,6 @@ function bindingifyInput(input) {
|
|
|
3724
3805
|
};
|
|
3725
3806
|
});
|
|
3726
3807
|
}
|
|
3727
|
-
function bindingifyJsx(onLog, input, transform) {
|
|
3728
|
-
if (transform?.jsx) {
|
|
3729
|
-
if (input !== void 0) onLog(LOG_LEVEL_WARN, logDuplicateJsxConfig());
|
|
3730
|
-
return { transform };
|
|
3731
|
-
}
|
|
3732
|
-
if (typeof input === "object") {
|
|
3733
|
-
if (input.mode === "preserve") return {
|
|
3734
|
-
jsx: BindingJsx.Preserve,
|
|
3735
|
-
transform
|
|
3736
|
-
};
|
|
3737
|
-
const mode = input.mode ?? "automatic";
|
|
3738
|
-
transform ??= {};
|
|
3739
|
-
transform.jsx = {
|
|
3740
|
-
runtime: mode,
|
|
3741
|
-
pragma: input.factory,
|
|
3742
|
-
pragmaFrag: input.fragment,
|
|
3743
|
-
importSource: mode === "classic" ? input.importSource : mode === "automatic" ? input.jsxImportSource : void 0
|
|
3744
|
-
};
|
|
3745
|
-
return { transform };
|
|
3746
|
-
}
|
|
3747
|
-
let jsx;
|
|
3748
|
-
switch (input) {
|
|
3749
|
-
case false:
|
|
3750
|
-
jsx = BindingJsx.Disable;
|
|
3751
|
-
break;
|
|
3752
|
-
case "react":
|
|
3753
|
-
jsx = BindingJsx.React;
|
|
3754
|
-
break;
|
|
3755
|
-
case "react-jsx":
|
|
3756
|
-
jsx = BindingJsx.ReactJsx;
|
|
3757
|
-
break;
|
|
3758
|
-
case "preserve":
|
|
3759
|
-
jsx = BindingJsx.Preserve;
|
|
3760
|
-
break;
|
|
3761
|
-
}
|
|
3762
|
-
return {
|
|
3763
|
-
jsx,
|
|
3764
|
-
transform
|
|
3765
|
-
};
|
|
3766
|
-
}
|
|
3767
3808
|
function bindingifyWatch(watch$1) {
|
|
3768
3809
|
if (watch$1) return {
|
|
3769
3810
|
buildDelay: watch$1.buildDelay,
|
|
@@ -3850,7 +3891,7 @@ var ChunkingContextImpl = class {
|
|
|
3850
3891
|
//#endregion
|
|
3851
3892
|
//#region src/utils/bindingify-output-options.ts
|
|
3852
3893
|
function bindingifyOutputOptions(outputOptions) {
|
|
3853
|
-
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
|
|
3894
|
+
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir } = outputOptions;
|
|
3854
3895
|
const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
|
|
3855
3896
|
return {
|
|
3856
3897
|
dir,
|
|
@@ -3869,6 +3910,7 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3869
3910
|
outro: bindingifyAddon(outro),
|
|
3870
3911
|
extend: outputOptions.extend,
|
|
3871
3912
|
globals,
|
|
3913
|
+
paths,
|
|
3872
3914
|
generatedCode,
|
|
3873
3915
|
esModule,
|
|
3874
3916
|
name,
|
|
@@ -3889,7 +3931,8 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
3889
3931
|
legalComments,
|
|
3890
3932
|
preserveModulesRoot,
|
|
3891
3933
|
topLevelVar,
|
|
3892
|
-
minifyInternalExports: outputOptions.minifyInternalExports
|
|
3934
|
+
minifyInternalExports: outputOptions.minifyInternalExports,
|
|
3935
|
+
cleanDir
|
|
3893
3936
|
};
|
|
3894
3937
|
}
|
|
3895
3938
|
function bindingifyAddon(configAddon) {
|
|
@@ -4269,4 +4312,4 @@ function defineConfig(config) {
|
|
|
4269
4312
|
const VERSION = version;
|
|
4270
4313
|
|
|
4271
4314
|
//#endregion
|
|
4272
|
-
export {
|
|
4315
|
+
export { onExit as C, version as S, validateCliOptions as _, rolldown as a, makeBuiltinPluginCallable as b, normalizedStringOrRegex as c, transformToRollupOutput as d, normalizeBindingResult as f, getOutputCliKeys as g, getInputCliKeys as h, build as i, PluginContextData as l, getCliSchemaInfo as m, defineConfig as n, RolldownBuild as o, bindingifySourcemap$1 as p, watch as r, createBundlerOptions as s, VERSION as t, bindingifyPlugin as u, PluginDriver as v, description$1 as x, BuiltinPlugin as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.44",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://rolldown.rs/",
|
|
@@ -75,9 +75,8 @@
|
|
|
75
75
|
"dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\ntype BindingResult<T> = { errors: BindingError[], isBindingErrors: boolean } | T\n\n"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@oxc-project/types": "=0.
|
|
79
|
-
"
|
|
80
|
-
"@rolldown/pluginutils": "1.0.0-beta.42"
|
|
78
|
+
"@oxc-project/types": "=0.95.0",
|
|
79
|
+
"@rolldown/pluginutils": "1.0.0-beta.44"
|
|
81
80
|
},
|
|
82
81
|
"devDependencies": {
|
|
83
82
|
"@napi-rs/cli": "^3.2.0",
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
"consola": "^3.4.2",
|
|
89
88
|
"execa": "^9.2.0",
|
|
90
89
|
"glob": "^11.0.0",
|
|
91
|
-
"oxc-parser": "=0.
|
|
90
|
+
"oxc-parser": "=0.95.0",
|
|
92
91
|
"pathe": "^2.0.3",
|
|
93
92
|
"remeda": "^2.10.0",
|
|
94
93
|
"rolldown-plugin-dts": "^0.16.0",
|
|
@@ -99,26 +98,26 @@
|
|
|
99
98
|
"typedoc": "^0.28.0",
|
|
100
99
|
"typescript": "^5.8.3",
|
|
101
100
|
"valibot": "1.1.0",
|
|
102
|
-
"rolldown": "1.0.0-beta.
|
|
101
|
+
"rolldown": "1.0.0-beta.44"
|
|
103
102
|
},
|
|
104
103
|
"engines": {
|
|
105
104
|
"node": "^20.19.0 || >=22.12.0"
|
|
106
105
|
},
|
|
107
106
|
"optionalDependencies": {
|
|
108
|
-
"@rolldown/binding-darwin-x64": "1.0.0-beta.
|
|
109
|
-
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.
|
|
110
|
-
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.
|
|
111
|
-
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.
|
|
112
|
-
"@rolldown/binding-freebsd-x64": "1.0.0-beta.
|
|
113
|
-
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.
|
|
114
|
-
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.
|
|
115
|
-
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.
|
|
116
|
-
"@rolldown/binding-darwin-arm64": "1.0.0-beta.
|
|
117
|
-
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.
|
|
118
|
-
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.
|
|
119
|
-
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.
|
|
120
|
-
"@rolldown/binding-android-arm64": "1.0.0-beta.
|
|
121
|
-
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.
|
|
107
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.44",
|
|
108
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.44",
|
|
109
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.44",
|
|
110
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.44",
|
|
111
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.44",
|
|
112
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.44",
|
|
113
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.44",
|
|
114
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.44",
|
|
115
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.44",
|
|
116
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.44",
|
|
117
|
+
"@rolldown/binding-openharmony-arm64": "1.0.0-beta.44",
|
|
118
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.44",
|
|
119
|
+
"@rolldown/binding-android-arm64": "1.0.0-beta.44",
|
|
120
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.44"
|
|
122
121
|
},
|
|
123
122
|
"scripts": {
|
|
124
123
|
"# Scrips for binding #": "_",
|