rolldown 0.10.5 → 0.11.0

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.
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ const { createBundler, transformToRollupOutput } = require("./utils_index-PYoHCZRc.cjs");
4
+
5
+ //#region src/rolldown-build.ts
6
+ class RolldownBuild {
7
+ #inputOptions;
8
+ #bundler;
9
+ #stopWorkers;
10
+ constructor(inputOptions) {
11
+ this.#inputOptions = inputOptions;
12
+ }
13
+ async #getBundler(outputOptions) {
14
+ if (typeof this.#bundler === 'undefined') {
15
+ const { bundler, stopWorkers } = await createBundler(this.#inputOptions, outputOptions);
16
+ this.#bundler = bundler;
17
+ this.#stopWorkers = stopWorkers;
18
+ }
19
+ return this.#bundler;
20
+ }
21
+ async generate(outputOptions = {}) {
22
+ const bundler = await this.#getBundler(outputOptions);
23
+ const output = await bundler.generate();
24
+ return transformToRollupOutput(output);
25
+ }
26
+ async write(outputOptions = {}) {
27
+ const bundler = await this.#getBundler(outputOptions);
28
+ const output = await bundler.write();
29
+ return transformToRollupOutput(output);
30
+ }
31
+ async destroy() {
32
+ await this.#stopWorkers?.();
33
+ }
34
+ }
35
+
36
+ //#endregion
37
+ //#region src/rolldown.ts
38
+ const rolldown = async (input) => {
39
+ return new RolldownBuild(input);
40
+ };
41
+ const experimental_scan = async (input) => {
42
+ const { bundler, stopWorkers } = await createBundler(input, {});
43
+ await bundler.scan();
44
+ await stopWorkers?.();
45
+ };
46
+
47
+ //#endregion
48
+ exports.experimental_scan = experimental_scan;
49
+ exports.rolldown = rolldown;
@@ -0,0 +1,48 @@
1
+ import __node_module__ from 'node:module';
2
+ const require = __node_module__.createRequire(import.meta.url)
3
+ import { createBundler, transformToRollupOutput } from "./utils_index-DAvBTBzR.mjs";
4
+
5
+ //#region src/rolldown-build.ts
6
+ class RolldownBuild {
7
+ #inputOptions;
8
+ #bundler;
9
+ #stopWorkers;
10
+ constructor(inputOptions) {
11
+ this.#inputOptions = inputOptions;
12
+ }
13
+ async #getBundler(outputOptions) {
14
+ if (typeof this.#bundler === 'undefined') {
15
+ const { bundler, stopWorkers } = await createBundler(this.#inputOptions, outputOptions);
16
+ this.#bundler = bundler;
17
+ this.#stopWorkers = stopWorkers;
18
+ }
19
+ return this.#bundler;
20
+ }
21
+ async generate(outputOptions = {}) {
22
+ const bundler = await this.#getBundler(outputOptions);
23
+ const output = await bundler.generate();
24
+ return transformToRollupOutput(output);
25
+ }
26
+ async write(outputOptions = {}) {
27
+ const bundler = await this.#getBundler(outputOptions);
28
+ const output = await bundler.write();
29
+ return transformToRollupOutput(output);
30
+ }
31
+ async destroy() {
32
+ await this.#stopWorkers?.();
33
+ }
34
+ }
35
+
36
+ //#endregion
37
+ //#region src/rolldown.ts
38
+ const rolldown = async (input) => {
39
+ return new RolldownBuild(input);
40
+ };
41
+ const experimental_scan = async (input) => {
42
+ const { bundler, stopWorkers } = await createBundler(input, {});
43
+ await bundler.scan();
44
+ await stopWorkers?.();
45
+ };
46
+
47
+ //#endregion
48
+ export { experimental_scan, rolldown };