@rollipop/rolldown 1.0.0-rc.2 → 1.0.0-rc.3
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-setup.mjs +1 -1
- package/dist/cli.mjs +27 -996
- package/dist/config.d.mts +10 -5
- package/dist/config.mjs +9 -12
- package/dist/experimental-index.d.mts +72 -14
- package/dist/experimental-index.mjs +64 -11
- package/dist/experimental-runtime-types.d.ts +0 -5
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +24 -1
- package/dist/get-log-filter.d.mts +3 -7
- package/dist/get-log-filter.mjs +23 -2
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +10 -9
- package/dist/parallel-plugin-worker.mjs +5 -4
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +26 -2
- package/dist/parse-ast-index.mjs +61 -2
- package/dist/plugins-index.d.mts +8 -5
- package/dist/plugins-index.mjs +8 -5
- package/dist/shared/{binding-Bo6UcGYl.d.mts → binding-C4ZlFAt6.d.mts} +302 -117
- package/dist/shared/{binding-9QXxzPo6.mjs → binding-D25Pz9Tj.mjs} +32 -26
- package/dist/shared/{bindingify-input-options-C--dZCPv.mjs → bindingify-input-options-D6jfpJ6l.mjs} +52 -113
- package/dist/shared/{constructors-DsYXT8FB.mjs → constructors-BAGdj697.mjs} +8 -5
- package/dist/shared/{constructors-B64fS2o1.d.mts → constructors-C-tyKVjw.d.mts} +9 -4
- package/dist/shared/{define-config-DT_Hpxdr.d.mts → define-config-BKLqq_zt.d.mts} +148 -43
- package/dist/shared/error-BoaGIj5N.mjs +90 -0
- package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
- package/dist/shared/{load-config-TBowPn4n.mjs → load-config-CV5K8wKJ.mjs} +10 -2
- package/dist/shared/{logs-NH298mHo.mjs → logs-CCc_0vhs.mjs} +1 -1
- package/dist/shared/{normalize-string-or-regex-CaBvmZZK.mjs → normalize-string-or-regex-tBSnk6HY.mjs} +2 -2
- package/dist/shared/parse-DWZRPGsB.mjs +77 -0
- package/dist/shared/{rolldown-5hTSdYMy.mjs → rolldown-CZ1SIh-x.mjs} +1 -1
- package/dist/shared/{rolldown-build-B7oitB1K.mjs → rolldown-build-BYA-VVk0.mjs} +1019 -26
- package/dist/shared/transform-CIcvJTbn.mjs +93 -0
- package/dist/shared/transform-DoG7c5_r.d.mts +132 -0
- package/dist/shared/{watch-CkctCkiN.mjs → watch-DV7vV2OV.mjs} +6 -5
- package/dist/utils-index.d.mts +376 -0
- package/dist/utils-index.mjs +2426 -0
- package/package.json +17 -16
- package/dist/shared/parse-ast-index-BQ9Myuc2.mjs +0 -99
- /package/dist/shared/{define-config-BVG4QvnP.mjs → define-config-BMj_QknW.mjs} +0 -0
- /package/dist/shared/{logging-CE90D8JR.d.mts → logging-C6h4g8dA.d.mts} +0 -0
- /package/dist/shared/{misc-CCZIsXVO.mjs → misc-Xty885dB.mjs} +0 -0
- /package/dist/shared/{prompt-CI-U8Lh4.mjs → prompt-B56gTa4S.mjs} +0 -0
package/dist/config.d.mts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { r as defineConfig, t as ConfigExport } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-C4ZlFAt6.mjs";
|
|
2
|
+
import { P as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-BKLqq_zt.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/load-config.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Load config from a file in a way that Rolldown does.
|
|
7
|
+
*
|
|
8
|
+
* @param configPath The path to the config file. If empty, it will look for `rolldown.config` with supported extensions in the current working directory.
|
|
9
|
+
* @returns The loaded config export
|
|
10
|
+
*
|
|
11
|
+
* @category Config
|
|
12
|
+
*/
|
|
5
13
|
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
|
6
14
|
//#endregion
|
|
7
|
-
//#region src/config.d.ts
|
|
8
|
-
declare const VERSION: string;
|
|
9
|
-
//#endregion
|
|
10
15
|
export { VERSION, defineConfig, loadConfig };
|
package/dist/config.mjs
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import "./shared/normalize-string-or-regex-
|
|
3
|
-
import {
|
|
4
|
-
import "./shared/rolldown-build-
|
|
5
|
-
import "./shared/
|
|
6
|
-
import "./shared/
|
|
7
|
-
import
|
|
8
|
-
import { t as
|
|
1
|
+
import "./shared/binding-D25Pz9Tj.mjs";
|
|
2
|
+
import "./shared/normalize-string-or-regex-tBSnk6HY.mjs";
|
|
3
|
+
import { b as VERSION } from "./shared/bindingify-input-options-D6jfpJ6l.mjs";
|
|
4
|
+
import "./shared/rolldown-build-BYA-VVk0.mjs";
|
|
5
|
+
import "./shared/error-BoaGIj5N.mjs";
|
|
6
|
+
import "./shared/parse-DWZRPGsB.mjs";
|
|
7
|
+
import "./shared/rolldown-CZ1SIh-x.mjs";
|
|
8
|
+
import { t as defineConfig } from "./shared/define-config-BMj_QknW.mjs";
|
|
9
|
+
import { t as loadConfig } from "./shared/load-config-CV5K8wKJ.mjs";
|
|
9
10
|
|
|
10
|
-
//#region src/config.ts
|
|
11
|
-
const VERSION = version;
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
11
|
export { VERSION, defineConfig, loadConfig };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
3
|
-
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin,
|
|
1
|
+
import { A as IsolatedDeclarationsOptions, B as ResolverFactory, D as BindingViteTransformPluginConfig, F as NapiResolveOptions, G as isolatedDeclaration, J as resolveTsconfig, K as isolatedDeclarationSync, S as BindingViteManifestPluginConfig, U as TsconfigCache$1, W as createTokioRuntime, _ as BindingTsconfigRawOptions, f as BindingRebuildStrategy, g as BindingTsconfigCompilerOptions, i as BindingClientHmrUpdate, j as IsolatedDeclarationsResult, n as BindingBundleAnalyzerPluginConfig, q as moduleRunnerTransform, r as BindingBundleState, z as ResolveResult } from "./shared/binding-C4ZlFAt6.mjs";
|
|
2
|
+
import { Gt as freeExternalMemory, J as defineParallelPlugin, M as BuiltinPlugin, Pt as OutputOptions, Ut as RolldownOutput, at as NormalizedOutputOptions, c as InputOptions } from "./shared/define-config-BKLqq_zt.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-C-tyKVjw.mjs";
|
|
4
|
+
import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, n as TransformResult$1, o as MinifyResult$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-DoG7c5_r.mjs";
|
|
4
5
|
|
|
5
6
|
//#region src/api/dev/dev-options.d.ts
|
|
6
7
|
type DevOnHmrUpdates = (result: Error | {
|
|
@@ -110,16 +111,6 @@ declare const dev: typeof DevEngine.create;
|
|
|
110
111
|
*/
|
|
111
112
|
declare const scan: (rawInputOptions: InputOptions, rawOutputOptions?: {}) => Promise<Promise<void>>;
|
|
112
113
|
//#endregion
|
|
113
|
-
//#region src/utils/parse.d.ts
|
|
114
|
-
/**
|
|
115
|
-
* Parse asynchronously.
|
|
116
|
-
*
|
|
117
|
-
* Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
|
|
118
|
-
*/
|
|
119
|
-
declare function parse(filename: string, sourceText: string, options?: ParserOptions | null): Promise<ParseResult>;
|
|
120
|
-
/** Parse synchronously. */
|
|
121
|
-
declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | null): ParseResult;
|
|
122
|
-
//#endregion
|
|
123
114
|
//#region src/builtin-plugin/alias-plugin.d.ts
|
|
124
115
|
type ViteAliasPluginConfig = {
|
|
125
116
|
entries: {
|
|
@@ -129,6 +120,43 @@ type ViteAliasPluginConfig = {
|
|
|
129
120
|
};
|
|
130
121
|
declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
|
|
131
122
|
//#endregion
|
|
123
|
+
//#region src/builtin-plugin/bundle-analyzer-plugin.d.ts
|
|
124
|
+
/**
|
|
125
|
+
* A plugin that analyzes bundle composition and generates detailed reports.
|
|
126
|
+
*
|
|
127
|
+
* The plugin outputs a JSON file containing detailed information about:
|
|
128
|
+
* - All chunks and their relationships
|
|
129
|
+
* - Modules bundled in each chunk
|
|
130
|
+
* - Import dependencies between chunks
|
|
131
|
+
* - Reachable modules from each entry point
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```js
|
|
135
|
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
136
|
+
*
|
|
137
|
+
* export default {
|
|
138
|
+
* plugins: [
|
|
139
|
+
* bundleAnalyzerPlugin()
|
|
140
|
+
* ]
|
|
141
|
+
* }
|
|
142
|
+
* ```
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* **Custom filename**
|
|
146
|
+
* ```js
|
|
147
|
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
148
|
+
*
|
|
149
|
+
* export default {
|
|
150
|
+
* plugins: [
|
|
151
|
+
* bundleAnalyzerPlugin({
|
|
152
|
+
* fileName: 'bundle-analysis.json'
|
|
153
|
+
* })
|
|
154
|
+
* ]
|
|
155
|
+
* }
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
declare function bundleAnalyzerPlugin(config?: BindingBundleAnalyzerPluginConfig): BuiltinPlugin;
|
|
159
|
+
//#endregion
|
|
132
160
|
//#region src/builtin-plugin/transform-plugin.d.ts
|
|
133
161
|
type TransformPattern = string | RegExp | readonly (RegExp | string)[];
|
|
134
162
|
type TransformPluginConfig = Omit<BindingViteTransformPluginConfig, "include" | "exclude" | "jsxRefreshInclude" | "jsxRefreshExclude" | "yarnPnp"> & {
|
|
@@ -177,5 +205,35 @@ declare const memfs: {
|
|
|
177
205
|
fs: any;
|
|
178
206
|
volume: any;
|
|
179
207
|
} | undefined;
|
|
208
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
209
|
+
declare const parse: typeof parse$1;
|
|
210
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
211
|
+
declare const parseSync: typeof parseSync$1;
|
|
212
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
213
|
+
type ParseResult = ParseResult$1;
|
|
214
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
215
|
+
type ParserOptions = ParserOptions$1;
|
|
216
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
217
|
+
declare const minify: typeof minify$1;
|
|
218
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
219
|
+
declare const minifySync: typeof minifySync$1;
|
|
220
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
221
|
+
type MinifyOptions = MinifyOptions$1;
|
|
222
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
223
|
+
type MinifyResult = MinifyResult$1;
|
|
224
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
225
|
+
declare const transform: typeof transform$1;
|
|
226
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
227
|
+
declare const transformSync: typeof transformSync$1;
|
|
228
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
229
|
+
type TransformOptions = TransformOptions$1;
|
|
230
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
231
|
+
type TransformResult = TransformResult$1;
|
|
232
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
233
|
+
declare const TsconfigCache: typeof TsconfigCache$1;
|
|
234
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
235
|
+
type TsconfigRawOptions = BindingTsconfigRawOptions;
|
|
236
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
237
|
+
type TsconfigCompilerOptions = BindingTsconfigCompilerOptions;
|
|
180
238
|
//#endregion
|
|
181
|
-
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult,
|
|
239
|
+
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, MinifyOptions, MinifyResult, ParseResult, ParserOptions, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, TransformOptions, TransformResult, TsconfigCache, TsconfigCompilerOptions, TsconfigRawOptions, bundleAnalyzerPlugin, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, resolveTsconfig, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWebWorkerPostPlugin };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as
|
|
6
|
-
import {
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-D25Pz9Tj.mjs";
|
|
2
|
+
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-tBSnk6HY.mjs";
|
|
3
|
+
import { a as transformToRollupOutput } from "./shared/bindingify-input-options-D6jfpJ6l.mjs";
|
|
4
|
+
import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-BYA-VVk0.mjs";
|
|
5
|
+
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-BoaGIj5N.mjs";
|
|
6
|
+
import { n as parseSync$1, t as parse$1 } from "./shared/parse-DWZRPGsB.mjs";
|
|
7
|
+
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-BAGdj697.mjs";
|
|
8
|
+
import { a as minifySync$1, i as minify$1, n as transform$1, r as transformSync$1, t as import_binding$1 } from "./shared/transform-CIcvJTbn.mjs";
|
|
7
9
|
import { pathToFileURL } from "node:url";
|
|
8
10
|
|
|
9
11
|
//#region src/api/dev/dev-engine.ts
|
|
@@ -202,6 +204,46 @@ function viteAliasPlugin(config) {
|
|
|
202
204
|
return new BuiltinPlugin("builtin:vite-alias", config);
|
|
203
205
|
}
|
|
204
206
|
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/builtin-plugin/bundle-analyzer-plugin.ts
|
|
209
|
+
/**
|
|
210
|
+
* A plugin that analyzes bundle composition and generates detailed reports.
|
|
211
|
+
*
|
|
212
|
+
* The plugin outputs a JSON file containing detailed information about:
|
|
213
|
+
* - All chunks and their relationships
|
|
214
|
+
* - Modules bundled in each chunk
|
|
215
|
+
* - Import dependencies between chunks
|
|
216
|
+
* - Reachable modules from each entry point
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```js
|
|
220
|
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
221
|
+
*
|
|
222
|
+
* export default {
|
|
223
|
+
* plugins: [
|
|
224
|
+
* bundleAnalyzerPlugin()
|
|
225
|
+
* ]
|
|
226
|
+
* }
|
|
227
|
+
* ```
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* **Custom filename**
|
|
231
|
+
* ```js
|
|
232
|
+
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
|
|
233
|
+
*
|
|
234
|
+
* export default {
|
|
235
|
+
* plugins: [
|
|
236
|
+
* bundleAnalyzerPlugin({
|
|
237
|
+
* fileName: 'bundle-analysis.json'
|
|
238
|
+
* })
|
|
239
|
+
* ]
|
|
240
|
+
* }
|
|
241
|
+
* ```
|
|
242
|
+
*/
|
|
243
|
+
function bundleAnalyzerPlugin(config) {
|
|
244
|
+
return new BuiltinPlugin("builtin:bundle-analyzer", config);
|
|
245
|
+
}
|
|
246
|
+
|
|
205
247
|
//#endregion
|
|
206
248
|
//#region src/builtin-plugin/transform-plugin.ts
|
|
207
249
|
function viteTransformPlugin(config) {
|
|
@@ -251,6 +293,20 @@ function viteManifestPlugin(config) {
|
|
|
251
293
|
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
|
|
252
294
|
*/
|
|
253
295
|
const memfs = void 0;
|
|
296
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
297
|
+
const parse = parse$1;
|
|
298
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
299
|
+
const parseSync = parseSync$1;
|
|
300
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
301
|
+
const minify = minify$1;
|
|
302
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
303
|
+
const minifySync = minifySync$1;
|
|
304
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
305
|
+
const transform = transform$1;
|
|
306
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
307
|
+
const transformSync = transformSync$1;
|
|
308
|
+
/** @deprecated Use from `rolldown/utils` instead. */
|
|
309
|
+
const TsconfigCache = import_binding$1.TsconfigCache;
|
|
254
310
|
|
|
255
311
|
//#endregion
|
|
256
312
|
var BindingRebuildStrategy = import_binding.BindingRebuildStrategy;
|
|
@@ -258,9 +314,6 @@ var ResolverFactory = import_binding.ResolverFactory;
|
|
|
258
314
|
var createTokioRuntime = import_binding.createTokioRuntime;
|
|
259
315
|
var isolatedDeclaration = import_binding.isolatedDeclaration;
|
|
260
316
|
var isolatedDeclarationSync = import_binding.isolatedDeclarationSync;
|
|
261
|
-
var minify = import_binding.minify;
|
|
262
|
-
var minifySync = import_binding.minifySync;
|
|
263
317
|
var moduleRunnerTransform = import_binding.moduleRunnerTransform;
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
export { BindingRebuildStrategy, DevEngine, ResolverFactory, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };
|
|
318
|
+
var resolveTsconfig = import_binding.resolveTsconfig;
|
|
319
|
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, TsconfigCache, bundleAnalyzerPlugin, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, resolveTsconfig, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWebWorkerPostPlugin };
|
|
@@ -69,12 +69,7 @@ export class DevRuntime {
|
|
|
69
69
|
__toDynamicImportESM: (isNodeMode?: boolean) => (mod: any) => any;
|
|
70
70
|
/** @internal */
|
|
71
71
|
__reExport: any;
|
|
72
|
-
cache: string[];
|
|
73
|
-
timeout: NodeJS.Timeout | null;
|
|
74
|
-
timeoutSetLength: number;
|
|
75
|
-
/** @type {(module: string) => void} */
|
|
76
72
|
sendModuleRegisteredMessage: (module: string) => void;
|
|
77
|
-
flush(): void;
|
|
78
73
|
}
|
|
79
74
|
export type DevRuntimeMessage = {
|
|
80
75
|
type: "hmr:module-registered";
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { j as withFilter } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-C4ZlFAt6.mjs";
|
|
2
|
+
import { j as withFilter } from "./shared/define-config-BKLqq_zt.mjs";
|
|
3
3
|
|
|
4
4
|
//#region ../pluginutils/dist/filter/composable-filters.d.ts
|
|
5
5
|
type StringOrRegExp = string | RegExp;
|
package/dist/filter-index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as isPromiseLike, t as arraify } from "./shared/misc-
|
|
1
|
+
import { n as isPromiseLike, t as arraify } from "./shared/misc-Xty885dB.mjs";
|
|
2
2
|
|
|
3
3
|
//#region ../pluginutils/dist/utils.js
|
|
4
4
|
const postfixRE = /[?#].*$/;
|
|
@@ -352,6 +352,29 @@ function withFilterImpl(pluginOption, filterObjectList) {
|
|
|
352
352
|
});
|
|
353
353
|
return plugin;
|
|
354
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* A helper function to add plugin hook filters to a plugin or an array of plugins.
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```ts
|
|
360
|
+
* import yaml from '@rollup/plugin-yaml';
|
|
361
|
+
* import { defineConfig } from 'rolldown';
|
|
362
|
+
* import { withFilter } from 'rolldown/filter';
|
|
363
|
+
*
|
|
364
|
+
* export default defineConfig({
|
|
365
|
+
* plugins: [
|
|
366
|
+
* // Run the transform hook of the `yaml` plugin
|
|
367
|
+
* // only for modules which end in `.yaml`
|
|
368
|
+
* withFilter(
|
|
369
|
+
* yaml({}),
|
|
370
|
+
* { transform: { id: /\.yaml$/ } },
|
|
371
|
+
* ),
|
|
372
|
+
* ],
|
|
373
|
+
* });
|
|
374
|
+
* ```
|
|
375
|
+
*
|
|
376
|
+
* @category Config
|
|
377
|
+
*/
|
|
355
378
|
function withFilter(pluginOption, filterObject) {
|
|
356
379
|
return withFilterImpl(pluginOption, arraify(filterObject));
|
|
357
380
|
}
|
|
@@ -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) => {
|
|
@@ -42,7 +64,6 @@ const testFilter = (log, key, parts) => {
|
|
|
42
64
|
}
|
|
43
65
|
return value.endsWith(parts[lastPartIndex]);
|
|
44
66
|
};
|
|
45
|
-
var get_log_filter_default = getLogFilter;
|
|
46
67
|
|
|
47
68
|
//#endregion
|
|
48
|
-
export {
|
|
69
|
+
export { getLogFilter as default };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +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 {
|
|
3
|
-
import { $ as
|
|
4
|
-
export { AddonFunction, AdvancedChunksGroup, AdvancedChunksOptions, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, CodeSplittingGroup, CodeSplittingNameFunction, CodeSplittingOptions, 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, 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 };
|
|
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 { R as PreRenderedChunk, u as BindingMagicString } from "./shared/binding-C4ZlFAt6.mjs";
|
|
3
|
+
import { $ as ModuleTypeFilter, A as TransformResult, At as GeneratedCodePreset, B as EmittedAsset, Bt as OutputChunk, C as Plugin, Ct as ChunkFileNamesFunction, D as RolldownPlugin, Dt as CodeSplittingOptions, E as ResolvedId, Et as CodeSplittingNameFunction, F as ExistingRawSourceMap, Ft as PreRenderedAsset, G as PluginContext, H as EmittedFile, Ht as RenderedModule, I as SourceMapInput, K as PluginContextResolveOptions, Kt as ModuleInfo, L as OutputBundle, Lt as PartialNull, Mt as MinifyOptions, N as RUNTIME_MODULE_ID, Nt as ModuleFormat, O as RolldownPluginOption, Ot as CommentsOptions, P as VERSION, Pt as OutputOptions, Q as HookFilter, R as TreeshakingOptions, S as PartialResolvedId, St as AdvancedChunksOptions, T as ResolveIdResult, Tt as CodeSplittingGroup, U as EmittedPrebuiltChunk, Ut as RolldownOutput, V as EmittedChunk, Vt as RenderedChunk, W as GetModuleInfo, Wt as SourceMap, X as PluginContextMeta, Y as MinimalPluginContext, Z as GeneralHookFilter, _ as LoadResult, _t as RolldownBuild, a as ExternalOption, at as NormalizedOutputOptions, b as ObjectHook, bt as AddonFunction, c as InputOptions, ct as ChecksOptions, d as WatcherOptions, dt as watch, et as BufferEncoding, f as AsyncPluginHooks, ft as RolldownWatcher, g as ImportKind, gt as rolldown, h as HookFilterExtension, ht as WatchOptions, i as RolldownOptions, it as InternalModuleFormat, jt as GlobalsFunction, k as SourceDescription, kt as GeneratedCodeOptions, l as ModuleTypes, lt as LoggingFunction, m as FunctionPluginHooks, mt as RolldownWatcherWatcherEventMap, n as RolldownOptionsFunction, nt as RolldownFileStats, o as ExternalOptionFunction, ot as NormalizedInputOptions, p as CustomPluginOptions, pt as RolldownWatcherEvent, q as DefineParallelPluginResult, qt as SourcemapIgnoreListOption, r as defineConfig, rt as RolldownFsModule, s as InputOption, st as TransformOptions, t as ConfigExport, tt as RolldownDirectoryEntry, u as OptimizationOptions, ut as WarningHandlerWithDefault, v as ModuleOptions, vt as BuildOptions, w as ResolveIdExtraOptions, wt as ChunkingContext, x as ParallelPluginHooks, xt as AdvancedChunksGroup, y as ModuleType, yt as build, z as TransformPluginContext, zt as OutputAsset } from "./shared/define-config-BKLqq_zt.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,12 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
3
|
-
import "./shared/normalize-string-or-regex-
|
|
4
|
-
import {
|
|
5
|
-
import "./shared/rolldown-build-
|
|
6
|
-
import "./shared/
|
|
7
|
-
import
|
|
8
|
-
import { t as
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-D25Pz9Tj.mjs";
|
|
2
|
+
import { n as onExit, t as watch } from "./shared/watch-DV7vV2OV.mjs";
|
|
3
|
+
import "./shared/normalize-string-or-regex-tBSnk6HY.mjs";
|
|
4
|
+
import { b as VERSION, y as RUNTIME_MODULE_ID } from "./shared/bindingify-input-options-D6jfpJ6l.mjs";
|
|
5
|
+
import "./shared/rolldown-build-BYA-VVk0.mjs";
|
|
6
|
+
import "./shared/error-BoaGIj5N.mjs";
|
|
7
|
+
import "./shared/parse-DWZRPGsB.mjs";
|
|
8
|
+
import { t as rolldown } from "./shared/rolldown-CZ1SIh-x.mjs";
|
|
9
|
+
import { t as defineConfig } from "./shared/define-config-BMj_QknW.mjs";
|
|
9
10
|
import { isMainThread } from "node:worker_threads";
|
|
10
11
|
|
|
11
12
|
//#region src/setup.ts
|
|
@@ -54,4 +55,4 @@ async function build(options) {
|
|
|
54
55
|
|
|
55
56
|
//#endregion
|
|
56
57
|
var BindingMagicString = import_binding.BindingMagicString;
|
|
57
|
-
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
|
|
58
|
+
export { BindingMagicString, RUNTIME_MODULE_ID, VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import "./shared/normalize-string-or-regex-
|
|
3
|
-
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-
|
|
4
|
-
import "./shared/
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-D25Pz9Tj.mjs";
|
|
2
|
+
import "./shared/normalize-string-or-regex-tBSnk6HY.mjs";
|
|
3
|
+
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-D6jfpJ6l.mjs";
|
|
4
|
+
import "./shared/error-BoaGIj5N.mjs";
|
|
5
|
+
import "./shared/parse-DWZRPGsB.mjs";
|
|
5
6
|
import { parentPort, workerData } from "node:worker_threads";
|
|
6
7
|
|
|
7
8
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { C as Plugin,
|
|
1
|
+
import "./shared/binding-C4ZlFAt6.mjs";
|
|
2
|
+
import { C as Plugin, It as MaybePromise } from "./shared/define-config-BKLqq_zt.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
5
5
|
type ParallelPluginImplementation = Plugin;
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as ParseResult$1, L as ParserOptions$1 } from "./shared/binding-C4ZlFAt6.mjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
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,4 +1,63 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { n as
|
|
1
|
+
import "./shared/binding-D25Pz9Tj.mjs";
|
|
2
|
+
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-CCc_0vhs.mjs";
|
|
3
|
+
import { n as parseSync, t as parse } from "./shared/parse-DWZRPGsB.mjs";
|
|
3
4
|
|
|
5
|
+
//#region src/parse-ast-index.ts
|
|
6
|
+
function wrap(result, filename, sourceText) {
|
|
7
|
+
if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
|
|
8
|
+
return result.program;
|
|
9
|
+
}
|
|
10
|
+
function normalizeParseError(filename, sourceText, errors) {
|
|
11
|
+
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
12
|
+
const pos = errors[0]?.labels?.[0]?.start;
|
|
13
|
+
for (let i = 0; i < errors.length; i++) {
|
|
14
|
+
if (i >= 5) {
|
|
15
|
+
message += "\n...";
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
const e = errors[i];
|
|
19
|
+
message += e.message + "\n" + e.labels.map((label) => {
|
|
20
|
+
const location = locate(sourceText, label.start, { offsetLine: 1 });
|
|
21
|
+
if (!location) return;
|
|
22
|
+
return getCodeFrame(sourceText, location.line, location.column);
|
|
23
|
+
}).filter(Boolean).join("\n");
|
|
24
|
+
}
|
|
25
|
+
const log = logParseError(message, filename, pos);
|
|
26
|
+
if (pos !== void 0 && filename) augmentCodeLocation(log, pos, sourceText, filename);
|
|
27
|
+
return error(log);
|
|
28
|
+
}
|
|
29
|
+
const defaultParserOptions = {
|
|
30
|
+
lang: "js",
|
|
31
|
+
preserveParens: false
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Parse code synchronously and return the AST.
|
|
35
|
+
*
|
|
36
|
+
* This function is similar to Rollup's `parseAst` function.
|
|
37
|
+
* Prefer using {@linkcode parseSync} instead of this function as it has more information in the return value.
|
|
38
|
+
*
|
|
39
|
+
* @category Utilities
|
|
40
|
+
*/
|
|
41
|
+
function parseAst(sourceText, options, filename) {
|
|
42
|
+
return wrap(parseSync(filename ?? "file.js", sourceText, {
|
|
43
|
+
...defaultParserOptions,
|
|
44
|
+
...options
|
|
45
|
+
}), filename, sourceText);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parse code asynchronously and return the AST.
|
|
49
|
+
*
|
|
50
|
+
* This function is similar to Rollup's `parseAstAsync` function.
|
|
51
|
+
* Prefer using {@linkcode parseAsync} instead of this function as it has more information in the return value.
|
|
52
|
+
*
|
|
53
|
+
* @category Utilities
|
|
54
|
+
*/
|
|
55
|
+
async function parseAstAsync(sourceText, options, filename) {
|
|
56
|
+
return wrap(await parse(filename ?? "file.js", sourceText, {
|
|
57
|
+
...defaultParserOptions,
|
|
58
|
+
...options
|
|
59
|
+
}), filename, sourceText);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
4
63
|
export { parseAst, parseAstAsync };
|
package/dist/plugins-index.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { M as BuiltinPlugin } from "./shared/define-config-
|
|
3
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
1
|
+
import { m as BindingReplacePluginConfig } from "./shared/binding-C4ZlFAt6.mjs";
|
|
2
|
+
import { M as BuiltinPlugin } from "./shared/define-config-BKLqq_zt.mjs";
|
|
3
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-C-tyKVjw.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/builtin-plugin/replace-plugin.d.ts
|
|
6
6
|
/**
|
|
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 { t as esmExternalRequirePlugin } from "./shared/constructors-B64fS2o1.mj
|
|
|
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 { t as esmExternalRequirePlugin } from "./shared/constructors-B64fS2o1.mj
|
|
|
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,13 +1,13 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-
|
|
3
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
1
|
+
import "./shared/binding-D25Pz9Tj.mjs";
|
|
2
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-tBSnk6HY.mjs";
|
|
3
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-BAGdj697.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/builtin-plugin/replace-plugin.ts
|
|
6
6
|
/**
|
|
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 { t as esmExternalRequirePlugin } from "./shared/constructors-DsYXT8FB.mj
|
|
|
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 { t as esmExternalRequirePlugin } from "./shared/constructors-DsYXT8FB.mj
|
|
|
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
|
function replacePlugin(values = {}, options = {}) {
|
|
29
32
|
Object.keys(values).forEach((key) => {
|