rolldown 1.0.0-beta.15 → 1.0.0-beta.17
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.cjs +8 -8
- package/dist/cli.mjs +1042 -1081
- package/dist/config.cjs +3 -3
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -5
- package/dist/experimental-index.cjs +7 -31
- package/dist/experimental-index.d.cts +2 -2
- package/dist/experimental-index.d.mts +2 -2
- package/dist/experimental-index.mjs +4 -22
- package/dist/experimental-runtime-types.d.ts +52 -0
- package/dist/filter-index.d.cts +2 -2
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -4
- package/dist/parallel-plugin-worker.cjs +3 -4
- package/dist/parallel-plugin-worker.mjs +27 -34
- package/dist/parallel-plugin.d.cts +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.cts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -2
- package/dist/shared/{binding-CZdobbZA.d.cts → binding-CWvDTpOw.d.mts} +23 -15
- package/dist/shared/{binding-Dze8QVpf.d.mts → binding-um3VI33z.d.cts} +23 -15
- package/dist/shared/{define-config-De_1kjGz.d.mts → define-config-Cm86JHb7.d.mts} +73 -12
- package/dist/shared/{define-config-BE-fkZNW.d.cts → define-config-POPyhxOq.d.cts} +73 -12
- package/dist/shared/{load-config-Bq6nGoUg.cjs → load-config-B4zzmrcW.cjs} +1 -1
- package/dist/shared/{load-config-BOcke1T-.mjs → load-config-BlOqMlge.mjs} +14 -19
- package/dist/shared/{misc-DGAe2XOW.mjs → misc-BN0nse6C.mjs} +1 -4
- package/dist/shared/parse-ast-index-BpqxVgDm.mjs +616 -0
- package/dist/shared/parse-ast-index-XFcW-g8N.cjs +738 -0
- package/dist/shared/prompt-C5jz26Zn.mjs +852 -0
- package/dist/shared/{prompt-8EeOGx1_.cjs → prompt-QNI93ne7.cjs} +2 -2
- package/dist/shared/{src-aJubL6dq.cjs → src-C98Q0NLX.cjs} +63 -55
- package/dist/shared/{src-DBOqhEP1.mjs → src-CuIbdNSi.mjs} +1146 -1391
- package/package.json +22 -22
- package/dist/shared/chunk--iN_1bjD.mjs +0 -33
- package/dist/shared/parse-ast-index-BAuPesgO.mjs +0 -658
- package/dist/shared/parse-ast-index-C53MhHqY.cjs +0 -700
- package/dist/shared/prompt-Dc0i9ubg.mjs +0 -854
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName,
|
|
1
|
+
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-CWvDTpOw.mjs";
|
|
2
2
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
3
3
|
import { Program } from "@oxc-project/types";
|
|
4
4
|
|
|
@@ -170,7 +170,7 @@ interface OutputOptions {
|
|
|
170
170
|
externalLiveBindings?: boolean;
|
|
171
171
|
inlineDynamicImports?: boolean;
|
|
172
172
|
/**
|
|
173
|
-
* Allows you to do
|
|
173
|
+
* Allows you to do manual chunking. For deeper understanding, please refer to the in-depth [documentation](https://rolldown.rs/guide/in-depth/advanced-chunks).
|
|
174
174
|
*/
|
|
175
175
|
advancedChunks?: {
|
|
176
176
|
/**
|
|
@@ -211,6 +211,24 @@ interface OutputOptions {
|
|
|
211
211
|
* - Type: `string`
|
|
212
212
|
*
|
|
213
213
|
* Name of the group. It will be also used as the name of the chunk and replaced the `[name]` placeholder in the `chunkFileNames` option.
|
|
214
|
+
*
|
|
215
|
+
* For example,
|
|
216
|
+
*
|
|
217
|
+
* ```js
|
|
218
|
+
* import { defineConfig } from 'rolldown';
|
|
219
|
+
*
|
|
220
|
+
* export default defineConfig({
|
|
221
|
+
* advancedChunks: {
|
|
222
|
+
* groups: [
|
|
223
|
+
* {
|
|
224
|
+
* name: 'libs',
|
|
225
|
+
* test: /node_modules/,
|
|
226
|
+
* },
|
|
227
|
+
* ],
|
|
228
|
+
* },
|
|
229
|
+
* });
|
|
230
|
+
* ```
|
|
231
|
+
* will create a chunk named `libs-[hash].js` in the end.
|
|
214
232
|
*/
|
|
215
233
|
name: string;
|
|
216
234
|
/**
|
|
@@ -218,25 +236,50 @@ interface OutputOptions {
|
|
|
218
236
|
*
|
|
219
237
|
* Controls which modules are captured in this group.
|
|
220
238
|
*
|
|
221
|
-
* If `test` is a string, the module whose id contains the string will be captured.
|
|
222
|
-
* If `test` is a regular expression, the module whose id matches the regular expression will be captured.
|
|
223
|
-
* If `test` is a function, modules for which `test(id)` returns `true` will be captured.
|
|
224
|
-
*
|
|
239
|
+
* - If `test` is a string, the module whose id contains the string will be captured.
|
|
240
|
+
* - If `test` is a regular expression, the module whose id matches the regular expression will be captured.
|
|
241
|
+
* - If `test` is a function, modules for which `test(id)` returns `true` will be captured.
|
|
242
|
+
* - If `test` is empty, any module will be considered as matched.
|
|
225
243
|
*/
|
|
226
244
|
test?: StringOrRegExp | ((id: string) => boolean | undefined | void);
|
|
227
245
|
/**
|
|
228
246
|
* - Type: `number`
|
|
247
|
+
* - Default: `0`
|
|
229
248
|
*
|
|
230
249
|
* Priority of the group. Group with higher priority will be chosen first to match modules and create chunks. When converting the group to a chunk, modules of that group will be removed from other groups.
|
|
231
250
|
*
|
|
232
251
|
* If two groups have the same priority, the group whose index is smaller will be chosen.
|
|
252
|
+
*
|
|
253
|
+
* For example,
|
|
254
|
+
*
|
|
255
|
+
* ```js
|
|
256
|
+
* import { defineConfig } from 'rolldown';
|
|
257
|
+
*
|
|
258
|
+
* export default defineConfig({
|
|
259
|
+
* advancedChunks: {
|
|
260
|
+
* groups: [
|
|
261
|
+
* {
|
|
262
|
+
* name: 'react',
|
|
263
|
+
* test: /node_modules\/react/,
|
|
264
|
+
* priority: 1,
|
|
265
|
+
* },
|
|
266
|
+
* {
|
|
267
|
+
* name: 'other-libs',
|
|
268
|
+
* test: /node_modules/,
|
|
269
|
+
* priority: 2,
|
|
270
|
+
* },
|
|
271
|
+
* ],
|
|
272
|
+
* });
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* This is a clearly __incorrect__ example. Though `react` group is defined before `other-libs`, it has a lower priority, so the modules in `react` group will be captured in `other-libs` group.
|
|
233
276
|
*/
|
|
234
277
|
priority?: number;
|
|
235
278
|
/**
|
|
236
279
|
* - Type: `number`
|
|
237
280
|
* - Default: `0`
|
|
238
281
|
*
|
|
239
|
-
* Minimum size of the desired chunk. If accumulated size of captured modules is smaller than this value, this group will
|
|
282
|
+
* Minimum size of the desired chunk. If the accumulated size of the captured modules by this group is smaller than this value, it will be ignored. Modules in this group will fall back to the `automatic chunking` if they are not captured by any other group.
|
|
240
283
|
*/
|
|
241
284
|
minSize?: number;
|
|
242
285
|
/**
|
|
@@ -250,7 +293,7 @@ interface OutputOptions {
|
|
|
250
293
|
* - Type: `number`
|
|
251
294
|
* - Default: `Infinity`
|
|
252
295
|
*
|
|
253
|
-
* If
|
|
296
|
+
* If the accumulated size of the captured modules by this group is larger than this value, this group will be split into multiple groups that each has size close to this value.
|
|
254
297
|
*/
|
|
255
298
|
maxSize?: number;
|
|
256
299
|
/**
|
|
@@ -309,8 +352,8 @@ declare class RolldownBuild {
|
|
|
309
352
|
write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
|
|
310
353
|
close(): Promise<void>;
|
|
311
354
|
[Symbol.asyncDispose](): Promise<void>;
|
|
312
|
-
generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch
|
|
313
|
-
hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<
|
|
355
|
+
generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch>;
|
|
356
|
+
hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutputPatch>;
|
|
314
357
|
// TODO(underfin)
|
|
315
358
|
// The `watchFiles` method returns a promise, but Rollup does not.
|
|
316
359
|
// Converting it to a synchronous API might cause a deadlock if the user calls `write` and `watchFiles` simultaneously.
|
|
@@ -330,7 +373,7 @@ interface WatchOptions extends InputOptions {
|
|
|
330
373
|
type WatcherEvent = "close" | "event" | "restart" | "change";
|
|
331
374
|
type ChangeEvent$1 = "create" | "update" | "delete";
|
|
332
375
|
// TODO: find a way use `RolldownBuild` instead of `Bundler`.
|
|
333
|
-
type RolldownWatchBuild =
|
|
376
|
+
type RolldownWatchBuild = BindingBundlerImpl;
|
|
334
377
|
type RolldownWatcherEvent = {
|
|
335
378
|
code: "START";
|
|
336
379
|
} | {
|
|
@@ -878,6 +921,7 @@ type HmrOptions = boolean | {
|
|
|
878
921
|
port?: number;
|
|
879
922
|
implement?: string;
|
|
880
923
|
};
|
|
924
|
+
type AttachDebugOptions = "none" | "simple" | "full";
|
|
881
925
|
interface RollupJsxOptions {
|
|
882
926
|
mode?: "classic" | "automatic" | "preserve";
|
|
883
927
|
factory?: string;
|
|
@@ -936,7 +980,7 @@ interface InputOptions {
|
|
|
936
980
|
viteMode?: boolean;
|
|
937
981
|
resolveNewUrlToAsset?: boolean;
|
|
938
982
|
hmr?: HmrOptions;
|
|
939
|
-
attachDebugInfo?:
|
|
983
|
+
attachDebugInfo?: AttachDebugOptions;
|
|
940
984
|
};
|
|
941
985
|
/**
|
|
942
986
|
* Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
|
|
@@ -1019,6 +1063,23 @@ interface InputOptions {
|
|
|
1019
1063
|
* @default runtime = "automatic"
|
|
1020
1064
|
*/
|
|
1021
1065
|
jsx?: false | "react" | "react-jsx" | "preserve" | RollupJsxOptions;
|
|
1066
|
+
/**
|
|
1067
|
+
* Configure how the code is transformed. This process happens after the `transform` hook.
|
|
1068
|
+
*
|
|
1069
|
+
* To transpile [legacy decorators](https://github.com/tc39/proposal-decorators/tree/4ac0f4cd31bd0f2e8170cb4c5136e51671e46c8d), you could use
|
|
1070
|
+
*
|
|
1071
|
+
* ```js
|
|
1072
|
+
* export default defineConfig({
|
|
1073
|
+
* transform: {
|
|
1074
|
+
* decorator: {
|
|
1075
|
+
* legacy: true,
|
|
1076
|
+
* },
|
|
1077
|
+
* },
|
|
1078
|
+
* })
|
|
1079
|
+
* ```
|
|
1080
|
+
*
|
|
1081
|
+
* For latest decorators proposal, rolldown is able to bundle them but doesn't support transpiling them yet.
|
|
1082
|
+
*/
|
|
1022
1083
|
transform?: OxcTransformOption;
|
|
1023
1084
|
watch?: WatcherOptions | false;
|
|
1024
1085
|
dropLabels?: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName,
|
|
1
|
+
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-um3VI33z.cjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
|
|
@@ -170,7 +170,7 @@ interface OutputOptions {
|
|
|
170
170
|
externalLiveBindings?: boolean;
|
|
171
171
|
inlineDynamicImports?: boolean;
|
|
172
172
|
/**
|
|
173
|
-
* Allows you to do
|
|
173
|
+
* Allows you to do manual chunking. For deeper understanding, please refer to the in-depth [documentation](https://rolldown.rs/guide/in-depth/advanced-chunks).
|
|
174
174
|
*/
|
|
175
175
|
advancedChunks?: {
|
|
176
176
|
/**
|
|
@@ -211,6 +211,24 @@ interface OutputOptions {
|
|
|
211
211
|
* - Type: `string`
|
|
212
212
|
*
|
|
213
213
|
* Name of the group. It will be also used as the name of the chunk and replaced the `[name]` placeholder in the `chunkFileNames` option.
|
|
214
|
+
*
|
|
215
|
+
* For example,
|
|
216
|
+
*
|
|
217
|
+
* ```js
|
|
218
|
+
* import { defineConfig } from 'rolldown';
|
|
219
|
+
*
|
|
220
|
+
* export default defineConfig({
|
|
221
|
+
* advancedChunks: {
|
|
222
|
+
* groups: [
|
|
223
|
+
* {
|
|
224
|
+
* name: 'libs',
|
|
225
|
+
* test: /node_modules/,
|
|
226
|
+
* },
|
|
227
|
+
* ],
|
|
228
|
+
* },
|
|
229
|
+
* });
|
|
230
|
+
* ```
|
|
231
|
+
* will create a chunk named `libs-[hash].js` in the end.
|
|
214
232
|
*/
|
|
215
233
|
name: string;
|
|
216
234
|
/**
|
|
@@ -218,25 +236,50 @@ interface OutputOptions {
|
|
|
218
236
|
*
|
|
219
237
|
* Controls which modules are captured in this group.
|
|
220
238
|
*
|
|
221
|
-
* If `test` is a string, the module whose id contains the string will be captured.
|
|
222
|
-
* If `test` is a regular expression, the module whose id matches the regular expression will be captured.
|
|
223
|
-
* If `test` is a function, modules for which `test(id)` returns `true` will be captured.
|
|
224
|
-
*
|
|
239
|
+
* - If `test` is a string, the module whose id contains the string will be captured.
|
|
240
|
+
* - If `test` is a regular expression, the module whose id matches the regular expression will be captured.
|
|
241
|
+
* - If `test` is a function, modules for which `test(id)` returns `true` will be captured.
|
|
242
|
+
* - If `test` is empty, any module will be considered as matched.
|
|
225
243
|
*/
|
|
226
244
|
test?: StringOrRegExp | ((id: string) => boolean | undefined | void);
|
|
227
245
|
/**
|
|
228
246
|
* - Type: `number`
|
|
247
|
+
* - Default: `0`
|
|
229
248
|
*
|
|
230
249
|
* Priority of the group. Group with higher priority will be chosen first to match modules and create chunks. When converting the group to a chunk, modules of that group will be removed from other groups.
|
|
231
250
|
*
|
|
232
251
|
* If two groups have the same priority, the group whose index is smaller will be chosen.
|
|
252
|
+
*
|
|
253
|
+
* For example,
|
|
254
|
+
*
|
|
255
|
+
* ```js
|
|
256
|
+
* import { defineConfig } from 'rolldown';
|
|
257
|
+
*
|
|
258
|
+
* export default defineConfig({
|
|
259
|
+
* advancedChunks: {
|
|
260
|
+
* groups: [
|
|
261
|
+
* {
|
|
262
|
+
* name: 'react',
|
|
263
|
+
* test: /node_modules\/react/,
|
|
264
|
+
* priority: 1,
|
|
265
|
+
* },
|
|
266
|
+
* {
|
|
267
|
+
* name: 'other-libs',
|
|
268
|
+
* test: /node_modules/,
|
|
269
|
+
* priority: 2,
|
|
270
|
+
* },
|
|
271
|
+
* ],
|
|
272
|
+
* });
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* This is a clearly __incorrect__ example. Though `react` group is defined before `other-libs`, it has a lower priority, so the modules in `react` group will be captured in `other-libs` group.
|
|
233
276
|
*/
|
|
234
277
|
priority?: number;
|
|
235
278
|
/**
|
|
236
279
|
* - Type: `number`
|
|
237
280
|
* - Default: `0`
|
|
238
281
|
*
|
|
239
|
-
* Minimum size of the desired chunk. If accumulated size of captured modules is smaller than this value, this group will
|
|
282
|
+
* Minimum size of the desired chunk. If the accumulated size of the captured modules by this group is smaller than this value, it will be ignored. Modules in this group will fall back to the `automatic chunking` if they are not captured by any other group.
|
|
240
283
|
*/
|
|
241
284
|
minSize?: number;
|
|
242
285
|
/**
|
|
@@ -250,7 +293,7 @@ interface OutputOptions {
|
|
|
250
293
|
* - Type: `number`
|
|
251
294
|
* - Default: `Infinity`
|
|
252
295
|
*
|
|
253
|
-
* If
|
|
296
|
+
* If the accumulated size of the captured modules by this group is larger than this value, this group will be split into multiple groups that each has size close to this value.
|
|
254
297
|
*/
|
|
255
298
|
maxSize?: number;
|
|
256
299
|
/**
|
|
@@ -309,8 +352,8 @@ declare class RolldownBuild {
|
|
|
309
352
|
write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
|
|
310
353
|
close(): Promise<void>;
|
|
311
354
|
[Symbol.asyncDispose](): Promise<void>;
|
|
312
|
-
generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch
|
|
313
|
-
hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<
|
|
355
|
+
generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutputPatch>;
|
|
356
|
+
hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutputPatch>;
|
|
314
357
|
// TODO(underfin)
|
|
315
358
|
// The `watchFiles` method returns a promise, but Rollup does not.
|
|
316
359
|
// Converting it to a synchronous API might cause a deadlock if the user calls `write` and `watchFiles` simultaneously.
|
|
@@ -330,7 +373,7 @@ interface WatchOptions extends InputOptions {
|
|
|
330
373
|
type WatcherEvent = "close" | "event" | "restart" | "change";
|
|
331
374
|
type ChangeEvent$1 = "create" | "update" | "delete";
|
|
332
375
|
// TODO: find a way use `RolldownBuild` instead of `Bundler`.
|
|
333
|
-
type RolldownWatchBuild =
|
|
376
|
+
type RolldownWatchBuild = BindingBundlerImpl;
|
|
334
377
|
type RolldownWatcherEvent = {
|
|
335
378
|
code: "START";
|
|
336
379
|
} | {
|
|
@@ -878,6 +921,7 @@ type HmrOptions = boolean | {
|
|
|
878
921
|
port?: number;
|
|
879
922
|
implement?: string;
|
|
880
923
|
};
|
|
924
|
+
type AttachDebugOptions = "none" | "simple" | "full";
|
|
881
925
|
interface RollupJsxOptions {
|
|
882
926
|
mode?: "classic" | "automatic" | "preserve";
|
|
883
927
|
factory?: string;
|
|
@@ -936,7 +980,7 @@ interface InputOptions {
|
|
|
936
980
|
viteMode?: boolean;
|
|
937
981
|
resolveNewUrlToAsset?: boolean;
|
|
938
982
|
hmr?: HmrOptions;
|
|
939
|
-
attachDebugInfo?:
|
|
983
|
+
attachDebugInfo?: AttachDebugOptions;
|
|
940
984
|
};
|
|
941
985
|
/**
|
|
942
986
|
* Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
|
|
@@ -1019,6 +1063,23 @@ interface InputOptions {
|
|
|
1019
1063
|
* @default runtime = "automatic"
|
|
1020
1064
|
*/
|
|
1021
1065
|
jsx?: false | "react" | "react-jsx" | "preserve" | RollupJsxOptions;
|
|
1066
|
+
/**
|
|
1067
|
+
* Configure how the code is transformed. This process happens after the `transform` hook.
|
|
1068
|
+
*
|
|
1069
|
+
* To transpile [legacy decorators](https://github.com/tc39/proposal-decorators/tree/4ac0f4cd31bd0f2e8170cb4c5136e51671e46c8d), you could use
|
|
1070
|
+
*
|
|
1071
|
+
* ```js
|
|
1072
|
+
* export default defineConfig({
|
|
1073
|
+
* transform: {
|
|
1074
|
+
* decorator: {
|
|
1075
|
+
* legacy: true,
|
|
1076
|
+
* },
|
|
1077
|
+
* },
|
|
1078
|
+
* })
|
|
1079
|
+
* ```
|
|
1080
|
+
*
|
|
1081
|
+
* For latest decorators proposal, rolldown is able to bundle them but doesn't support transpiling them yet.
|
|
1082
|
+
*/
|
|
1022
1083
|
transform?: OxcTransformOption;
|
|
1023
1084
|
watch?: WatcherOptions | false;
|
|
1024
1085
|
dropLabels?: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DDkG_k5U.cjs');
|
|
2
|
-
const require_src = require('./src-
|
|
2
|
+
const require_src = require('./src-C98Q0NLX.cjs');
|
|
3
3
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { init_rolldown, rolldown } from "./src-DBOqhEP1.mjs";
|
|
1
|
+
import { rolldown } from "./src-CuIbdNSi.mjs";
|
|
3
2
|
import fs from "node:fs";
|
|
4
3
|
import path from "node:path";
|
|
5
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -48,6 +47,18 @@ async function bundleTsConfig(configFile, isEsm) {
|
|
|
48
47
|
const fileName = result.output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
49
48
|
return path.join(outputDir, fileName);
|
|
50
49
|
}
|
|
50
|
+
const SUPPORTED_JS_CONFIG_FORMATS = [
|
|
51
|
+
".js",
|
|
52
|
+
".mjs",
|
|
53
|
+
".cjs"
|
|
54
|
+
];
|
|
55
|
+
const SUPPORTED_TS_CONFIG_FORMATS = [
|
|
56
|
+
".ts",
|
|
57
|
+
".mts",
|
|
58
|
+
".cts"
|
|
59
|
+
];
|
|
60
|
+
const SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
|
61
|
+
const DEFAULT_CONFIG_BASE = "rolldown.config";
|
|
51
62
|
async function findConfigFileNameInCwd() {
|
|
52
63
|
const filesInWorkingDirectory = new Set(await readdir(cwd()));
|
|
53
64
|
for (const extension of SUPPORTED_CONFIG_FORMATS) {
|
|
@@ -103,22 +114,6 @@ async function loadConfig(configPath) {
|
|
|
103
114
|
throw new Error("Error happened while loading config.", { cause: err });
|
|
104
115
|
}
|
|
105
116
|
}
|
|
106
|
-
var SUPPORTED_JS_CONFIG_FORMATS, SUPPORTED_TS_CONFIG_FORMATS, SUPPORTED_CONFIG_FORMATS, DEFAULT_CONFIG_BASE;
|
|
107
|
-
var init_load_config = __esm({ "src/utils/load-config.ts"() {
|
|
108
|
-
init_rolldown();
|
|
109
|
-
SUPPORTED_JS_CONFIG_FORMATS = [
|
|
110
|
-
".js",
|
|
111
|
-
".mjs",
|
|
112
|
-
".cjs"
|
|
113
|
-
];
|
|
114
|
-
SUPPORTED_TS_CONFIG_FORMATS = [
|
|
115
|
-
".ts",
|
|
116
|
-
".mts",
|
|
117
|
-
".cts"
|
|
118
|
-
];
|
|
119
|
-
SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
|
120
|
-
DEFAULT_CONFIG_BASE = "rolldown.config";
|
|
121
|
-
} });
|
|
122
117
|
|
|
123
118
|
//#endregion
|
|
124
|
-
export {
|
|
119
|
+
export { loadConfig };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { __esm } from "./chunk--iN_1bjD.mjs";
|
|
2
|
-
|
|
3
1
|
//#region src/utils/misc.ts
|
|
4
2
|
function arraify(value) {
|
|
5
3
|
return Array.isArray(value) ? value : [value];
|
|
@@ -22,7 +20,6 @@ function unsupported(info) {
|
|
|
22
20
|
throw new Error(`UNSUPPORTED: ${info}`);
|
|
23
21
|
}
|
|
24
22
|
function noop(..._args) {}
|
|
25
|
-
var init_misc = __esm({ "src/utils/misc.ts"() {} });
|
|
26
23
|
|
|
27
24
|
//#endregion
|
|
28
|
-
export { arraify,
|
|
25
|
+
export { arraify, isNullish, isPromiseLike, noop, unimplemented, unreachable, unsupported };
|