@rolldown/browser 1.0.0-rc.4 → 1.0.0-rc.6
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 +24 -14
- package/dist/config.d.mts +9 -1
- package/dist/config.mjs +8 -8
- package/dist/{constructors-D2wC6vT5.js → constructors-WyngiSlS.js} +6 -0
- package/dist/{error-DfXdOVMF.js → error-D4EjR7H_.js} +9 -5
- package/dist/experimental-index.browser.mjs +4 -4
- package/dist/experimental-index.d.mts +8 -8
- package/dist/experimental-index.mjs +7 -7
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +24 -1
- package/dist/get-log-filter.d.mts +3 -7
- package/dist/get-log-filter.mjs +22 -0
- package/dist/index.browser.mjs +2 -2
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +8 -8
- package/dist/parallel-plugin-worker.mjs +4 -4
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +27 -3
- package/dist/parse-ast-index.mjs +17 -1
- package/dist/plugins-index.browser.mjs +6 -3
- package/dist/plugins-index.d.mts +7 -4
- package/dist/plugins-index.mjs +7 -4
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-gXO5p6r0.js → rolldown-build-DwnjyX40.js} +31 -28
- package/dist/shared/{bindingify-input-options-B32m-wO8.mjs → bindingify-input-options-CSIYh5O4.mjs} +17 -21
- package/dist/shared/{constructors-f9W8MQZ_.mjs → constructors-B2viugwd.mjs} +7 -1
- package/dist/shared/{constructors-CtryxP-m.d.mts → constructors-C1tQjDsj.d.mts} +7 -1
- package/dist/shared/{define-config-MImu5XA0.d.mts → define-config-DMEhSrNE.d.mts} +98 -30
- package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
- package/dist/shared/{load-config-nINjF42i.mjs → load-config-CmC4WvoS.mjs} +9 -1
- package/dist/shared/{parse-C5IFYsFB.mjs → parse-DIZtKd4C.mjs} +9 -5
- package/dist/shared/{rolldown-CkjERUOD.mjs → rolldown-D7O5_axp.mjs} +1 -1
- package/dist/shared/{rolldown-build-nvl-pSiK.mjs → rolldown-build-BV90HQts.mjs} +13 -14
- package/dist/shared/{transform-ChAcTNv3.d.mts → transform-BSAGL1b_.d.mts} +64 -24
- package/dist/shared/{transform-DhHPKnL-.mjs → transform-D49mi4JH.mjs} +12 -10
- package/dist/shared/{types-C2Sw7GCQ.d.mts → types-Cx3HYorz.d.mts} +4 -2
- package/dist/shared/{watch-CC4jn0NJ.mjs → watch-COON6c2j.mjs} +4 -4
- package/dist/{transform-DmR2FE2Q.js → transform-qJgOBSav.js} +12 -10
- package/dist/utils-index.browser.mjs +2422 -3
- package/dist/utils-index.d.mts +374 -2
- package/dist/utils-index.mjs +2423 -4
- package/package.json +1 -1
- /package/dist/shared/{composable-filters-CIxSuZSM.mjs → composable-filters-C_jBPRPI.mjs} +0 -0
- /package/dist/shared/{define-config-BVG4QvnP.mjs → define-config-BMj_QknW.mjs} +0 -0
- /package/dist/shared/{error-DTJQ7tjB.mjs → error-DDzqVYr_.mjs} +0 -0
- /package/dist/shared/{logging-C28dTP71.d.mts → logging-C6h4g8dA.d.mts} +0 -0
- /package/dist/shared/{normalize-string-or-regex-CdT2cmt4.mjs → normalize-string-or-regex-FTOVR1Jb.mjs} +0 -0
- /package/dist/shared/{prompt-BcvPElI8.mjs → prompt-B56gTa4S.mjs} +0 -0
- /package/dist/shared/{utils-DOXNRW_3.d.mts → utils-6wxe_LMG.d.mts} +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
2
|
-
import "./shared/normalize-string-or-regex-
|
|
3
|
-
import { S as version, x as description } from "./shared/bindingify-input-options-
|
|
4
|
-
import { h as arraify } from "./shared/composable-filters-
|
|
5
|
-
import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText$1, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-
|
|
6
|
-
import "./shared/error-
|
|
7
|
-
import "./shared/parse-
|
|
8
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
9
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
1
|
+
import { n as onExit, t as watch } from "./shared/watch-COON6c2j.mjs";
|
|
2
|
+
import "./shared/normalize-string-or-regex-FTOVR1Jb.mjs";
|
|
3
|
+
import { S as version, x as description } from "./shared/bindingify-input-options-CSIYh5O4.mjs";
|
|
4
|
+
import { h as arraify } from "./shared/composable-filters-C_jBPRPI.mjs";
|
|
5
|
+
import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText$1, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-BV90HQts.mjs";
|
|
6
|
+
import "./shared/error-DDzqVYr_.mjs";
|
|
7
|
+
import "./shared/parse-DIZtKd4C.mjs";
|
|
8
|
+
import { t as rolldown } from "./shared/rolldown-D7O5_axp.mjs";
|
|
9
|
+
import { t as loadConfig } from "./shared/load-config-CmC4WvoS.mjs";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { parseArgs } from "node:util";
|
|
12
12
|
import process$1 from "node:process";
|
|
@@ -21,8 +21,14 @@ const alias = {
|
|
|
21
21
|
help: { abbreviation: "h" },
|
|
22
22
|
version: { abbreviation: "v" },
|
|
23
23
|
watch: { abbreviation: "w" },
|
|
24
|
-
dir: {
|
|
25
|
-
|
|
24
|
+
dir: {
|
|
25
|
+
abbreviation: "d",
|
|
26
|
+
requireValue: true
|
|
27
|
+
},
|
|
28
|
+
file: {
|
|
29
|
+
abbreviation: "o",
|
|
30
|
+
requireValue: true
|
|
31
|
+
},
|
|
26
32
|
external: { abbreviation: "e" },
|
|
27
33
|
format: { abbreviation: "f" },
|
|
28
34
|
name: { abbreviation: "n" },
|
|
@@ -174,9 +180,13 @@ function parseCliArguments() {
|
|
|
174
180
|
let type = originalInfo.type;
|
|
175
181
|
if (type === "string" && typeof option.value !== "string") {
|
|
176
182
|
let opt = option;
|
|
177
|
-
let
|
|
183
|
+
let config = Object.getOwnPropertyDescriptor(alias, opt.name)?.value;
|
|
184
|
+
if (config?.requireValue) {
|
|
185
|
+
logger.error(`Option \`--${camelCaseToKebabCase(opt.name)}\` requires a value but none was provided.`);
|
|
186
|
+
process.exit(1);
|
|
187
|
+
}
|
|
178
188
|
Object.defineProperty(values, opt.name, {
|
|
179
|
-
value:
|
|
189
|
+
value: config?.default ?? "",
|
|
180
190
|
enumerable: true,
|
|
181
191
|
configurable: true,
|
|
182
192
|
writable: true
|
|
@@ -258,7 +268,7 @@ function getClearScreenFunction(options) {
|
|
|
258
268
|
}
|
|
259
269
|
|
|
260
270
|
//#endregion
|
|
261
|
-
//#region \0@oxc-project+runtime@0.
|
|
271
|
+
//#region \0@oxc-project+runtime@0.115.0/helpers/usingCtx.js
|
|
262
272
|
function _usingCtx() {
|
|
263
273
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
264
274
|
var n = Error();
|
package/dist/config.d.mts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-DMEhSrNE.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/load-config.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Load config from a file in a way that Rolldown does.
|
|
6
|
+
*
|
|
7
|
+
* @param configPath The path to the config file. If empty, it will look for `rolldown.config` with supported extensions in the current working directory.
|
|
8
|
+
* @returns The loaded config export
|
|
9
|
+
*
|
|
10
|
+
* @category Config
|
|
11
|
+
*/
|
|
4
12
|
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
|
5
13
|
//#endregion
|
|
6
14
|
export { VERSION, defineConfig, loadConfig };
|
package/dist/config.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./shared/normalize-string-or-regex-
|
|
2
|
-
import { b as VERSION } from "./shared/bindingify-input-options-
|
|
3
|
-
import "./shared/rolldown-build-
|
|
4
|
-
import "./shared/error-
|
|
5
|
-
import "./shared/parse-
|
|
6
|
-
import "./shared/rolldown-
|
|
7
|
-
import { t as defineConfig } from "./shared/define-config-
|
|
8
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
1
|
+
import "./shared/normalize-string-or-regex-FTOVR1Jb.mjs";
|
|
2
|
+
import { b as VERSION } from "./shared/bindingify-input-options-CSIYh5O4.mjs";
|
|
3
|
+
import "./shared/rolldown-build-BV90HQts.mjs";
|
|
4
|
+
import "./shared/error-DDzqVYr_.mjs";
|
|
5
|
+
import "./shared/parse-DIZtKd4C.mjs";
|
|
6
|
+
import "./shared/rolldown-D7O5_axp.mjs";
|
|
7
|
+
import { t as defineConfig } from "./shared/define-config-BMj_QknW.mjs";
|
|
8
|
+
import { t as loadConfig } from "./shared/load-config-CmC4WvoS.mjs";
|
|
9
9
|
|
|
10
10
|
export { VERSION, defineConfig, loadConfig };
|
|
@@ -41,6 +41,12 @@ function isolatedDeclarationPlugin(config) {
|
|
|
41
41
|
function viteWebWorkerPostPlugin() {
|
|
42
42
|
return new BuiltinPlugin("builtin:vite-web-worker-post");
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* A plugin that converts CommonJS require() calls for external dependencies into ESM import statements.
|
|
46
|
+
*
|
|
47
|
+
* @see https://rolldown.rs/builtin-plugins/esm-external-require
|
|
48
|
+
* @category Builtin Plugins
|
|
49
|
+
*/
|
|
44
50
|
function esmExternalRequirePlugin(config) {
|
|
45
51
|
const plugin = new BuiltinPlugin("builtin:esm-external-require", config);
|
|
46
52
|
plugin.enforce = "pre";
|
|
@@ -16,7 +16,7 @@ function bindingifySourcemap(map) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
19
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.115.0/node_modules/oxc-parser/src-js/wrap.js
|
|
20
20
|
function wrap(result) {
|
|
21
21
|
let program, module, comments, errors;
|
|
22
22
|
return {
|
|
@@ -64,8 +64,10 @@ function applyFix(program, fixPath) {
|
|
|
64
64
|
*
|
|
65
65
|
* i.e. the majority of the workload cannot be parallelized by using this method.
|
|
66
66
|
*
|
|
67
|
-
* Generally
|
|
67
|
+
* Generally {@linkcode parseSync} is preferable to use as it does not have the overhead of spawning a thread.
|
|
68
68
|
* If you need to parallelize parsing multiple files, it is recommended to use worker threads.
|
|
69
|
+
*
|
|
70
|
+
* @category Utilities
|
|
69
71
|
*/
|
|
70
72
|
async function parse$1(filename, sourceText, options) {
|
|
71
73
|
return wrap(await parse(filename, sourceText, options));
|
|
@@ -73,12 +75,14 @@ async function parse$1(filename, sourceText, options) {
|
|
|
73
75
|
/**
|
|
74
76
|
* Parse JS/TS source synchronously on current thread.
|
|
75
77
|
*
|
|
76
|
-
* This is generally preferable over
|
|
78
|
+
* This is generally preferable over {@linkcode parse} (async) as it does not have the overhead
|
|
77
79
|
* of spawning a thread, and the majority of the workload cannot be parallelized anyway
|
|
78
|
-
* (see
|
|
80
|
+
* (see {@linkcode parse} documentation for details).
|
|
79
81
|
*
|
|
80
82
|
* If you need to parallelize parsing multiple files, it is recommended to use worker threads
|
|
81
|
-
* with
|
|
83
|
+
* with {@linkcode parseSync} rather than using {@linkcode parse}.
|
|
84
|
+
*
|
|
85
|
+
* @category Utilities
|
|
82
86
|
*/
|
|
83
87
|
function parseSync$1(filename, sourceText, options) {
|
|
84
88
|
return wrap(parseSync(filename, sourceText, options));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-B0X1hEA4.js";
|
|
2
|
-
import { a as PluginDriver, i as validateOption, n as createBundlerOptions, r as transformToRollupOutput, t as RolldownBuild } from "./rolldown-build-
|
|
3
|
-
import { a as parse$2, i as unwrapBindingResult, o as parseSync$2, r as normalizeBindingResult } from "./error-
|
|
4
|
-
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWebWorkerPostPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./constructors-
|
|
5
|
-
import { a as minifySync$2, i as minify$2, n as transform$1, r as transformSync$1, t as TsconfigCache$1 } from "./transform-
|
|
2
|
+
import { a as PluginDriver, i as validateOption, n as createBundlerOptions, r as transformToRollupOutput, t as RolldownBuild } from "./rolldown-build-DwnjyX40.js";
|
|
3
|
+
import { a as parse$2, i as unwrapBindingResult, o as parseSync$2, r as normalizeBindingResult } from "./error-D4EjR7H_.js";
|
|
4
|
+
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWebWorkerPostPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./constructors-WyngiSlS.js";
|
|
5
|
+
import { a as minifySync$2, i as minify$2, n as transform$1, r as transformSync$1, t as TsconfigCache$1 } from "./transform-qJgOBSav.js";
|
|
6
6
|
import * as binding from "./rolldown-binding.wasi-browser.js";
|
|
7
7
|
import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, createTokioRuntime, isolatedDeclaration, isolatedDeclarationSync, moduleRunnerTransform, resolveTsconfig, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BuiltinPlugin } from "./shared/utils-
|
|
3
|
-
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWebWorkerPostPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-
|
|
4
|
-
import { a as TsconfigRawOptions$1, c as MinifyOptions$2, d as minifySync$1, f as ParseResult$
|
|
1
|
+
import { $t as OutputOptions, an as RolldownOutput, c as InputOptions, pt as defineParallelPlugin, sn as freeExternalMemory, wt as NormalizedOutputOptions } from "./shared/define-config-DMEhSrNE.mjs";
|
|
2
|
+
import { t as BuiltinPlugin } from "./shared/utils-6wxe_LMG.mjs";
|
|
3
|
+
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWebWorkerPostPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-C1tQjDsj.mjs";
|
|
4
|
+
import { a as TsconfigRawOptions$1, c as MinifyOptions$2, d as minifySync$1, f as ParseResult$3, h as parseSync$1, i as TsconfigCompilerOptions$1, l as MinifyResult$2, m as parse$1, n as TransformResult$1, o as transform$1, p as ParserOptions$3, r as TsconfigCache$1, s as transformSync$1, t as TransformOptions$2, u as minify$1 } from "./shared/transform-BSAGL1b_.mjs";
|
|
5
5
|
import { BindingBundleAnalyzerPluginConfig, BindingViteManifestPluginConfig, BindingViteTransformPluginConfig } from "../binding.cjs";
|
|
6
6
|
import { BindingBundleState, BindingClientHmrUpdate as BindingClientHmrUpdate$1 } from "../../binding.cjs";
|
|
7
7
|
import { BindingClientHmrUpdate, BindingRebuildStrategy, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions as ResolveOptions, ResolveResult, ResolverFactory, createTokioRuntime, isolatedDeclaration, isolatedDeclarationSync, moduleRunnerTransform, resolveTsconfig } from "./binding.cjs";
|
|
@@ -213,9 +213,9 @@ declare const parse: typeof parse$1;
|
|
|
213
213
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
214
214
|
declare const parseSync: typeof parseSync$1;
|
|
215
215
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
216
|
-
type ParseResult = ParseResult$
|
|
216
|
+
type ParseResult = ParseResult$3;
|
|
217
217
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
218
|
-
type ParserOptions = ParserOptions$
|
|
218
|
+
type ParserOptions = ParserOptions$3;
|
|
219
219
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
220
220
|
declare const minify: typeof minify$1;
|
|
221
221
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
@@ -223,13 +223,13 @@ declare const minifySync: typeof minifySync$1;
|
|
|
223
223
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
224
224
|
type MinifyOptions = MinifyOptions$2;
|
|
225
225
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
226
|
-
type MinifyResult = MinifyResult$
|
|
226
|
+
type MinifyResult = MinifyResult$2;
|
|
227
227
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
228
228
|
declare const transform: typeof transform$1;
|
|
229
229
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
230
230
|
declare const transformSync: typeof transformSync$1;
|
|
231
231
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
232
|
-
type TransformOptions =
|
|
232
|
+
type TransformOptions = TransformOptions$2;
|
|
233
233
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
234
234
|
type TransformResult = TransformResult$1;
|
|
235
235
|
/** @deprecated Use from `rolldown/utils` instead. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-
|
|
2
|
-
import { a as transformToRollupOutput } from "./shared/bindingify-input-options-
|
|
3
|
-
import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-
|
|
4
|
-
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-
|
|
5
|
-
import { n as parseSync$2, t as parse$2 } from "./shared/parse-
|
|
6
|
-
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWebWorkerPostPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-
|
|
7
|
-
import { a as minifySync$2, i as minify$2, n as transform$1, r as transformSync$1, t as TsconfigCache$1 } from "./shared/transform-
|
|
1
|
+
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-FTOVR1Jb.mjs";
|
|
2
|
+
import { a as transformToRollupOutput } from "./shared/bindingify-input-options-CSIYh5O4.mjs";
|
|
3
|
+
import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-BV90HQts.mjs";
|
|
4
|
+
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-DDzqVYr_.mjs";
|
|
5
|
+
import { n as parseSync$2, t as parse$2 } from "./shared/parse-DIZtKd4C.mjs";
|
|
6
|
+
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWebWorkerPostPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-B2viugwd.mjs";
|
|
7
|
+
import { a as minifySync$2, i as minify$2, n as transform$1, r as transformSync$1, t as TsconfigCache$1 } from "./shared/transform-D49mi4JH.mjs";
|
|
8
8
|
import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, createTokioRuntime, isolatedDeclaration, isolatedDeclarationSync, moduleRunnerTransform, resolveTsconfig, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi.cjs";
|
|
9
9
|
import { pathToFileURL } from "node:url";
|
|
10
10
|
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as id, F as TopLevelFilterExpression, G as moduleType, H as include, I as and, J as queries, K as not, L as code, M as FilterExpression, N as FilterExpressionKind, P as QueryFilterObject, R as exclude, U as interpreter, V as importerId, W as interpreterImpl, Y as query, j as withFilter, q as or, z as exprInterpreter } from "./shared/define-config-
|
|
1
|
+
import { B as id, F as TopLevelFilterExpression, G as moduleType, H as include, I as and, J as queries, K as not, L as code, M as FilterExpression, N as FilterExpressionKind, P as QueryFilterObject, R as exclude, U as interpreter, V as importerId, W as interpreterImpl, Y as query, j as withFilter, q as or, z as exprInterpreter } from "./shared/define-config-DMEhSrNE.mjs";
|
|
2
2
|
|
|
3
3
|
//#region ../pluginutils/dist/filter/filter-vite-plugins.d.ts
|
|
4
4
|
/**
|
package/dist/filter-index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as id, c as interpreter, d as not, f as or, g as isPromiseLike, h as arraify, i as exprInterpreter, l as interpreterImpl, m as query, n as code, o as importerId, p as queries, r as exclude, s as include, t as and, u as moduleType } from "./shared/composable-filters-
|
|
1
|
+
import { a as id, c as interpreter, d as not, f as or, g as isPromiseLike, h as arraify, i as exprInterpreter, l as interpreterImpl, m as query, n as code, o as importerId, p as queries, r as exclude, s as include, t as and, u as moduleType } from "./shared/composable-filters-C_jBPRPI.mjs";
|
|
2
2
|
|
|
3
3
|
//#region ../pluginutils/dist/filter/filter-vite-plugins.js
|
|
4
4
|
/**
|
|
@@ -147,6 +147,29 @@ function withFilterImpl(pluginOption, filterObjectList) {
|
|
|
147
147
|
});
|
|
148
148
|
return plugin;
|
|
149
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* A helper function to add plugin hook filters to a plugin or an array of plugins.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* import yaml from '@rollup/plugin-yaml';
|
|
156
|
+
* import { defineConfig } from 'rolldown';
|
|
157
|
+
* import { withFilter } from 'rolldown/filter';
|
|
158
|
+
*
|
|
159
|
+
* export default defineConfig({
|
|
160
|
+
* plugins: [
|
|
161
|
+
* // Run the transform hook of the `yaml` plugin
|
|
162
|
+
* // only for modules which end in `.yaml`
|
|
163
|
+
* withFilter(
|
|
164
|
+
* yaml({}),
|
|
165
|
+
* { transform: { id: /\.yaml$/ } },
|
|
166
|
+
* ),
|
|
167
|
+
* ],
|
|
168
|
+
* });
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* @category Config
|
|
172
|
+
*/
|
|
150
173
|
function withFilter(pluginOption, filterObject) {
|
|
151
174
|
return withFilterImpl(pluginOption, arraify(filterObject));
|
|
152
175
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { a as RolldownLog } from "./shared/logging-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type GetLogFilter = (filters: string[]) => (log: RolldownLog) => boolean;
|
|
5
|
-
declare const getLogFilter: GetLogFilter;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { GetLogFilter, type RolldownLog, type RolldownLog as RollupLog, getLogFilter as default };
|
|
1
|
+
import { a as RolldownLog } from "./shared/logging-C6h4g8dA.mjs";
|
|
2
|
+
import { n as getLogFilter, t as GetLogFilter } from "./shared/get-log-filter-semyr3Lj.mjs";
|
|
3
|
+
export { GetLogFilter, RolldownLog, RolldownLog as RollupLog, getLogFilter as default };
|
package/dist/get-log-filter.mjs
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
//#region src/get-log-filter.ts
|
|
2
|
+
/**
|
|
3
|
+
* A helper function to generate log filters using the same syntax as the CLI.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { defineConfig } from 'rolldown';
|
|
8
|
+
* import { getLogFilter } from 'rolldown/getLogFilter';
|
|
9
|
+
*
|
|
10
|
+
* const logFilter = getLogFilter(['code:FOO', 'code:BAR']);
|
|
11
|
+
*
|
|
12
|
+
* export default defineConfig({
|
|
13
|
+
* input: 'main.js',
|
|
14
|
+
* onLog(level, log, handler) {
|
|
15
|
+
* if (logFilter(log)) {
|
|
16
|
+
* handler(level, log);
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @category Config
|
|
23
|
+
*/
|
|
2
24
|
const getLogFilter = (filters) => {
|
|
3
25
|
if (filters.length === 0) return () => true;
|
|
4
26
|
const normalizedFilters = filters.map((filter) => filter.split("&").map((subFilter) => {
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as logMultiplyNotifyOption } from "./normalize-string-or-regex-B0X1hEA4.js";
|
|
2
|
-
import { a as PluginDriver, c as RUNTIME_MODULE_ID, i as validateOption, l as VERSION, n as createBundlerOptions, o as LOG_LEVEL_WARN, s as arraify, t as RolldownBuild } from "./rolldown-build-
|
|
3
|
-
import { t as aggregateBindingErrorsIntoJsError } from "./error-
|
|
2
|
+
import { a as PluginDriver, c as RUNTIME_MODULE_ID, i as validateOption, l as VERSION, n as createBundlerOptions, o as LOG_LEVEL_WARN, s as arraify, t as RolldownBuild } from "./rolldown-build-DwnjyX40.js";
|
|
3
|
+
import { t as aggregateBindingErrorsIntoJsError } from "./error-D4EjR7H_.js";
|
|
4
4
|
import { BindingMagicString, BindingWatcher, shutdownAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
5
5
|
|
|
6
6
|
//#region src/api/rolldown/index.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-
|
|
2
|
-
import { $ as
|
|
3
|
-
import { o as PartialNull } from "./shared/utils-
|
|
4
|
-
|
|
5
|
-
export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, BindingMagicString, type BufferEncoding, type BuildOptions, type ChecksOptions, type ChunkFileNamesFunction, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PluginContextResolveOptions, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
|
|
1
|
+
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-C6h4g8dA.mjs";
|
|
2
|
+
import { $ as VERSION, $t as OutputOptions, A as TransformResult, At as watch, Bt as AdvancedChunksGroup, C as Plugin, Ct as InternalModuleFormat, D as RolldownPlugin, Dt as ChecksOptions, E as ResolvedId, Et as TransformOptions, Ft as rolldown, Gt as CodeSplittingNameFunction, Ht as ChunkFileNamesFunction, It as RolldownBuild, Jt as GeneratedCodeOptions, Kt as CodeSplittingOptions, Lt as BuildOptions, Mt as RolldownWatcherEvent, Nt as RolldownWatcherWatcherEventMap, O as RolldownPluginOption, Ot as LoggingFunction, Pt as WatchOptions, Q as RUNTIME_MODULE_ID, Qt as ModuleFormat, Rt as build, S as PartialResolvedId, St as RolldownFsModule, T as ResolveIdResult, Tt as NormalizedInputOptions, Ut as ChunkingContext, Vt as AdvancedChunksOptions, Wt as CodeSplittingGroup, X as BindingMagicString, Xt as GlobalsFunction, Yt as GeneratedCodePreset, Z as PreRenderedChunk, Zt as MinifyOptions, _ as LoadResult, _t as HookFilter, a as ExternalOption, an as RolldownOutput, at as EmittedAsset, b as ObjectHook, bt as RolldownDirectoryEntry, c as InputOptions, cn as ModuleInfo, ct as EmittedPrebuiltChunk, d as WatcherOptions, dt as PluginContextResolveOptions, en as PreRenderedAsset, et as ExistingRawSourceMap, f as AsyncPluginHooks, ft as DefineParallelPluginResult, g as ImportKind, gt as GeneralHookFilter, h as HookFilterExtension, ht as PluginContextMeta, i as RolldownOptions, in as RenderedModule, it as TransformPluginContext, jt as RolldownWatcher, k as SourceDescription, kt as WarningHandlerWithDefault, l as ModuleTypes, ln as SourcemapIgnoreListOption, lt as GetModuleInfo, m as FunctionPluginHooks, mt as MinimalPluginContext, n as RolldownOptionsFunction, nn as OutputChunk, nt as OutputBundle, o as ExternalOptionFunction, on as SourceMap, ot as EmittedChunk, p as CustomPluginOptions, qt as CommentsOptions, r as defineConfig, rn as RenderedChunk, rt as TreeshakingOptions, s as InputOption, st as EmittedFile, t as ConfigExport, tn as OutputAsset, tt as SourceMapInput, u as OptimizationOptions, ut as PluginContext, v as ModuleOptions, vt as ModuleTypeFilter, w as ResolveIdExtraOptions, wt as NormalizedOutputOptions, x as ParallelPluginHooks, xt as RolldownFileStats, y as ModuleType, yt as BufferEncoding, zt as AddonFunction } from "./shared/define-config-DMEhSrNE.mjs";
|
|
3
|
+
import { o as PartialNull } from "./shared/utils-6wxe_LMG.mjs";
|
|
4
|
+
export { AddonFunction, AdvancedChunksGroup, AdvancedChunksOptions, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, CodeSplittingGroup, CodeSplittingNameFunction, CodeSplittingOptions, CommentsOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedChunk, EmittedFile, EmittedPrebuiltChunk, ExistingRawSourceMap, ExternalOption, ExternalOptionFunction, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PluginContextResolveOptions, PreRenderedAsset, PreRenderedChunk, RUNTIME_MODULE_ID, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownError, RolldownError as RollupError, RolldownFileStats, RolldownFsModule, RolldownLog, RolldownLog as RollupLog, RolldownLogWithString, RolldownLogWithString as RollupLogWithString, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RolldownWatcherWatcherEventMap, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformOptions, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
2
|
-
import "./shared/normalize-string-or-regex-
|
|
3
|
-
import { b as VERSION, y as RUNTIME_MODULE_ID } from "./shared/bindingify-input-options-
|
|
4
|
-
import "./shared/rolldown-build-
|
|
5
|
-
import "./shared/error-
|
|
6
|
-
import "./shared/parse-
|
|
7
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
8
|
-
import { t as defineConfig } from "./shared/define-config-
|
|
1
|
+
import { n as onExit, t as watch } from "./shared/watch-COON6c2j.mjs";
|
|
2
|
+
import "./shared/normalize-string-or-regex-FTOVR1Jb.mjs";
|
|
3
|
+
import { b as VERSION, y as RUNTIME_MODULE_ID } from "./shared/bindingify-input-options-CSIYh5O4.mjs";
|
|
4
|
+
import "./shared/rolldown-build-BV90HQts.mjs";
|
|
5
|
+
import "./shared/error-DDzqVYr_.mjs";
|
|
6
|
+
import "./shared/parse-DIZtKd4C.mjs";
|
|
7
|
+
import { t as rolldown } from "./shared/rolldown-D7O5_axp.mjs";
|
|
8
|
+
import { t as defineConfig } from "./shared/define-config-BMj_QknW.mjs";
|
|
9
9
|
import { isMainThread } from "node:worker_threads";
|
|
10
10
|
import { BindingMagicString, initTraceSubscriber } from "./rolldown-binding.wasi.cjs";
|
|
11
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./shared/normalize-string-or-regex-
|
|
2
|
-
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-
|
|
3
|
-
import "./shared/error-
|
|
4
|
-
import "./shared/parse-
|
|
1
|
+
import "./shared/normalize-string-or-regex-FTOVR1Jb.mjs";
|
|
2
|
+
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-CSIYh5O4.mjs";
|
|
3
|
+
import "./shared/error-DDzqVYr_.mjs";
|
|
4
|
+
import "./shared/parse-DIZtKd4C.mjs";
|
|
5
5
|
import { parentPort, workerData } from "node:worker_threads";
|
|
6
6
|
import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Plugin } from "./shared/define-config-
|
|
2
|
-
import { i as MaybePromise } from "./shared/utils-
|
|
1
|
+
import { C as Plugin } from "./shared/define-config-DMEhSrNE.mjs";
|
|
2
|
+
import { i as MaybePromise } from "./shared/utils-6wxe_LMG.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
5
5
|
type ParallelPluginImplementation = Plugin;
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ParseResult, ParserOptions } from "./binding.cjs";
|
|
1
|
+
import { Dt as Program } from "./shared/types-Cx3HYorz.mjs";
|
|
2
|
+
import { ParseResult as ParseResult$1, ParserOptions as ParserOptions$1 } from "./binding.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/parse-ast-index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
type ParseResult = ParseResult$1;
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
type ParserOptions = ParserOptions$1;
|
|
13
|
+
/**
|
|
14
|
+
* Parse code synchronously and return the AST.
|
|
15
|
+
*
|
|
16
|
+
* This function is similar to Rollup's `parseAst` function.
|
|
17
|
+
* Prefer using {@linkcode parseSync} instead of this function as it has more information in the return value.
|
|
18
|
+
*
|
|
19
|
+
* @category Utilities
|
|
20
|
+
*/
|
|
5
21
|
declare function parseAst(sourceText: string, options?: ParserOptions | null, filename?: string): Program;
|
|
22
|
+
/**
|
|
23
|
+
* Parse code asynchronously and return the AST.
|
|
24
|
+
*
|
|
25
|
+
* This function is similar to Rollup's `parseAstAsync` function.
|
|
26
|
+
* Prefer using {@linkcode parseAsync} instead of this function as it has more information in the return value.
|
|
27
|
+
*
|
|
28
|
+
* @category Utilities
|
|
29
|
+
*/
|
|
6
30
|
declare function parseAstAsync(sourceText: string, options?: ParserOptions | null, filename?: string): Promise<Program>;
|
|
7
31
|
//#endregion
|
|
8
|
-
export {
|
|
32
|
+
export { ParseResult, ParserOptions, parseAst, parseAstAsync };
|
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-CCc_0vhs.mjs";
|
|
2
|
-
import { n as parseSync, t as parse } from "./shared/parse-
|
|
2
|
+
import { n as parseSync, t as parse } from "./shared/parse-DIZtKd4C.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/parse-ast-index.ts
|
|
5
5
|
function wrap(result, filename, sourceText) {
|
|
@@ -29,12 +29,28 @@ const defaultParserOptions = {
|
|
|
29
29
|
lang: "js",
|
|
30
30
|
preserveParens: false
|
|
31
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Parse code synchronously and return the AST.
|
|
34
|
+
*
|
|
35
|
+
* This function is similar to Rollup's `parseAst` function.
|
|
36
|
+
* Prefer using {@linkcode parseSync} instead of this function as it has more information in the return value.
|
|
37
|
+
*
|
|
38
|
+
* @category Utilities
|
|
39
|
+
*/
|
|
32
40
|
function parseAst(sourceText, options, filename) {
|
|
33
41
|
return wrap(parseSync(filename ?? "file.js", sourceText, {
|
|
34
42
|
...defaultParserOptions,
|
|
35
43
|
...options
|
|
36
44
|
}), filename, sourceText);
|
|
37
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse code asynchronously and return the AST.
|
|
48
|
+
*
|
|
49
|
+
* This function is similar to Rollup's `parseAstAsync` function.
|
|
50
|
+
* Prefer using {@linkcode parseAsync} instead of this function as it has more information in the return value.
|
|
51
|
+
*
|
|
52
|
+
* @category Utilities
|
|
53
|
+
*/
|
|
38
54
|
async function parseAstAsync(sourceText, options, filename) {
|
|
39
55
|
return wrap(await parse(filename ?? "file.js", sourceText, {
|
|
40
56
|
...defaultParserOptions,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./normalize-string-or-regex-B0X1hEA4.js";
|
|
2
|
-
import { t as esmExternalRequirePlugin } from "./constructors-
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./constructors-WyngiSlS.js";
|
|
3
3
|
|
|
4
4
|
//#region src/builtin-plugin/replace-plugin.ts
|
|
5
5
|
/**
|
|
6
6
|
* Replaces targeted strings in files while bundling.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
*
|
|
9
|
+
* **Basic usage**
|
|
10
10
|
* ```js
|
|
11
11
|
* replacePlugin({
|
|
12
12
|
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
@@ -14,7 +14,7 @@ import { t as esmExternalRequirePlugin } from "./constructors-D2wC6vT5.js";
|
|
|
14
14
|
* })
|
|
15
15
|
* ```
|
|
16
16
|
* @example
|
|
17
|
-
*
|
|
17
|
+
* **With options**
|
|
18
18
|
* ```js
|
|
19
19
|
* replacePlugin({
|
|
20
20
|
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
@@ -23,6 +23,9 @@ import { t as esmExternalRequirePlugin } from "./constructors-D2wC6vT5.js";
|
|
|
23
23
|
* preventAssignment: false,
|
|
24
24
|
* })
|
|
25
25
|
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see https://rolldown.rs/builtin-plugins/replace
|
|
28
|
+
* @category Builtin Plugins
|
|
26
29
|
*/
|
|
27
30
|
function replacePlugin(values = {}, options = {}) {
|
|
28
31
|
Object.keys(values).forEach((key) => {
|
package/dist/plugins-index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as BuiltinPlugin } from "./shared/utils-
|
|
2
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
1
|
+
import { t as BuiltinPlugin } from "./shared/utils-6wxe_LMG.mjs";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-C1tQjDsj.mjs";
|
|
3
3
|
import { BindingReplacePluginConfig } from "../binding.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/builtin-plugin/replace-plugin.d.ts
|
|
@@ -7,7 +7,7 @@ import { BindingReplacePluginConfig } from "../binding.cjs";
|
|
|
7
7
|
* Replaces targeted strings in files while bundling.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
*
|
|
10
|
+
* **Basic usage**
|
|
11
11
|
* ```js
|
|
12
12
|
* replacePlugin({
|
|
13
13
|
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
@@ -15,7 +15,7 @@ import { BindingReplacePluginConfig } from "../binding.cjs";
|
|
|
15
15
|
* })
|
|
16
16
|
* ```
|
|
17
17
|
* @example
|
|
18
|
-
*
|
|
18
|
+
* **With options**
|
|
19
19
|
* ```js
|
|
20
20
|
* replacePlugin({
|
|
21
21
|
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
@@ -24,6 +24,9 @@ import { BindingReplacePluginConfig } from "../binding.cjs";
|
|
|
24
24
|
* preventAssignment: false,
|
|
25
25
|
* })
|
|
26
26
|
* ```
|
|
27
|
+
*
|
|
28
|
+
* @see https://rolldown.rs/builtin-plugins/replace
|
|
29
|
+
* @category Builtin Plugins
|
|
27
30
|
*/
|
|
28
31
|
declare function replacePlugin(values?: BindingReplacePluginConfig["values"], options?: Omit<BindingReplacePluginConfig, "values">): BuiltinPlugin;
|
|
29
32
|
//#endregion
|
package/dist/plugins-index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-
|
|
2
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-FTOVR1Jb.mjs";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-B2viugwd.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/builtin-plugin/replace-plugin.ts
|
|
5
5
|
/**
|
|
6
6
|
* Replaces targeted strings in files while bundling.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
*
|
|
9
|
+
* **Basic usage**
|
|
10
10
|
* ```js
|
|
11
11
|
* replacePlugin({
|
|
12
12
|
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
@@ -14,7 +14,7 @@ import { t as esmExternalRequirePlugin } from "./shared/constructors-f9W8MQZ_.mj
|
|
|
14
14
|
* })
|
|
15
15
|
* ```
|
|
16
16
|
* @example
|
|
17
|
-
*
|
|
17
|
+
* **With options**
|
|
18
18
|
* ```js
|
|
19
19
|
* replacePlugin({
|
|
20
20
|
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
@@ -23,6 +23,9 @@ import { t as esmExternalRequirePlugin } from "./shared/constructors-f9W8MQZ_.mj
|
|
|
23
23
|
* preventAssignment: false,
|
|
24
24
|
* })
|
|
25
25
|
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see https://rolldown.rs/builtin-plugins/replace
|
|
28
|
+
* @category Builtin Plugins
|
|
26
29
|
*/
|
|
27
30
|
function replacePlugin(values = {}, options = {}) {
|
|
28
31
|
Object.keys(values).forEach((key) => {
|
|
Binary file
|