rolldown 0.13.2-snapshot-e65437c-20241011073722 → 0.13.2-snapshot-bdde6fe-20241013003833
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/cjs/cli.cjs +20 -7
- package/dist/cjs/experimental-index.cjs +1 -1
- package/dist/cjs/index.cjs +2 -1
- package/dist/cjs/parallel-plugin-worker.cjs +1 -1
- package/dist/esm/cli.mjs +20 -7
- package/dist/esm/experimental-index.mjs +1 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/rolldown-binding.wasi.cjs +67 -67
- package/dist/shared/{src_index-yXEZE2lt.mjs → src_index-_6D8oVEl.mjs} +51 -4
- package/dist/shared/{src_index-tbUfWh5c.cjs → src_index-tm1mV84P.cjs} +51 -3
- package/dist/types/binding.d.ts +4 -0
- package/dist/types/cli/arguments/normalize.d.ts +1 -0
- package/dist/types/cli/arguments/schema.d.ts +3 -0
- package/dist/types/constants/plugin.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/plugin/bindingify-watch-hooks.d.ts +6 -0
- package/dist/types/plugin/index.d.ts +4 -0
- package/dist/types/rolldown-build.d.ts +1 -0
- package/dist/types/rolldown.d.ts +1 -0
- package/package.json +14 -14
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { __export, __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
|
|
4
|
-
const { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, arraify, description, rolldown, version } = require("../shared/src_index-
|
|
4
|
+
const { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, arraify, description, rolldown, version, watch } = require("../shared/src_index-tm1mV84P.cjs");
|
|
5
5
|
const { createConsola } = require("../shared/consola.36c0034f-HcmWcfPe.cjs");
|
|
6
6
|
const { default: nodePath } = __toESM(require("node:path"));
|
|
7
7
|
const { ZodFirstPartyTypeKind, ZodFirstPartyTypeKind: ZodFirstPartyTypeKind$1, ZodFirstPartyTypeKind: ZodFirstPartyTypeKind$2, z, z: z$1, z: z$2, z: z$3 } = __toESM(require("zod"));
|
|
@@ -123,13 +123,13 @@ async function bundleWithConfig(configPath, cliOptions) {
|
|
|
123
123
|
}
|
|
124
124
|
const configList = arraify(config);
|
|
125
125
|
for (const config$1 of configList) {
|
|
126
|
-
await bundleInner(config$1, cliOptions);
|
|
126
|
+
cliOptions.watch ? await watchInner(config$1, cliOptions) : bundleInner(config$1, cliOptions);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
async function bundleWithCliOptions(cliOptions) {
|
|
130
130
|
if (cliOptions.output.dir) {
|
|
131
|
-
await bundleInner({}, cliOptions);
|
|
132
|
-
} else {
|
|
131
|
+
cliOptions.watch ? await watchInner({}, cliOptions) : await bundleInner({}, cliOptions);
|
|
132
|
+
} else if (!cliOptions.watch) {
|
|
133
133
|
const build = await rolldown(cliOptions.input);
|
|
134
134
|
const { output: output } = await build.generate(cliOptions.output);
|
|
135
135
|
if (output.length > 1) {
|
|
@@ -141,8 +141,18 @@ async function bundleWithCliOptions(cliOptions) {
|
|
|
141
141
|
} else {
|
|
142
142
|
logger.log(output[0].code);
|
|
143
143
|
}
|
|
144
|
+
} else {
|
|
145
|
+
logger.error("You must specify `output.dir` to use watch mode");
|
|
146
|
+
process.exit(1);
|
|
144
147
|
}
|
|
145
148
|
}
|
|
149
|
+
async function watchInner(options$1, cliOptions) {
|
|
150
|
+
await watch({
|
|
151
|
+
...options$1,
|
|
152
|
+
...cliOptions.input
|
|
153
|
+
});
|
|
154
|
+
logger.log(`Waiting for changes...`);
|
|
155
|
+
}
|
|
146
156
|
async function bundleInner(options$1, cliOptions) {
|
|
147
157
|
const startTime = performance.now();
|
|
148
158
|
const build = await rolldown({
|
|
@@ -1417,7 +1427,8 @@ const outputCliOptionsSchema = (outputOptionsSchema.extend({
|
|
|
1417
1427
|
const cliOptionsSchema = ((z.strictObject({
|
|
1418
1428
|
config: (((z.string()).or(z.boolean())).describe("Path to the config file (default: `rolldown.config.js`)")).optional(),
|
|
1419
1429
|
help: ((z.boolean()).describe("Show help")).optional(),
|
|
1420
|
-
version: ((z.boolean()).describe("Show version number")).optional()
|
|
1430
|
+
version: ((z.boolean()).describe("Show version number")).optional(),
|
|
1431
|
+
watch: ((z.boolean()).describe("Watch files in bundle and rebuild on changes")).optional()
|
|
1421
1432
|
})).merge(inputCliOptionsSchema)).merge(outputCliOptionsSchema);
|
|
1422
1433
|
const schema = zodToJsonSchema(cliOptionsSchema);
|
|
1423
1434
|
|
|
@@ -1431,6 +1442,7 @@ const alias = {
|
|
|
1431
1442
|
},
|
|
1432
1443
|
help: {abbreviation: "h"},
|
|
1433
1444
|
version: {abbreviation: "v"},
|
|
1445
|
+
watch: {abbreviation: "w"},
|
|
1434
1446
|
dir: {abbreviation: "d"},
|
|
1435
1447
|
external: {abbreviation: "e"},
|
|
1436
1448
|
format: {abbreviation: "f"},
|
|
@@ -1520,12 +1532,13 @@ function normalizeCliOptions(cliOptions, positionals) {
|
|
|
1520
1532
|
input: {},
|
|
1521
1533
|
output: {},
|
|
1522
1534
|
help: options$1.help ?? false,
|
|
1523
|
-
version: options$1.version ?? false
|
|
1535
|
+
version: options$1.version ?? false,
|
|
1536
|
+
watch: options$1.watch ?? false
|
|
1524
1537
|
};
|
|
1525
1538
|
if (typeof options$1.config === "string") {
|
|
1526
1539
|
result.config = options$1.config ? options$1.config : "rolldown.config.js";
|
|
1527
1540
|
}
|
|
1528
|
-
const reservedKeys = ["help", "version", "config"];
|
|
1541
|
+
const reservedKeys = ["help", "version", "config", "watch"];
|
|
1529
1542
|
const keysOfInput = (inputCliOptionsSchema.keyof())._def.values;
|
|
1530
1543
|
const keysOfOutput = (outputCliOptionsSchema.keyof())._def.values;
|
|
1531
1544
|
for (let [key, value] of Object.entries(options$1)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
|
|
4
|
-
const { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } = require("../shared/src_index-
|
|
4
|
+
const { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } = require("../shared/src_index-tm1mV84P.cjs");
|
|
5
5
|
const { pathToFileURL } = __toESM(require("node:url"));
|
|
6
6
|
|
|
7
7
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const { VERSION, defineConfig, rolldown } = require("../shared/src_index-
|
|
3
|
+
const { VERSION, defineConfig, rolldown, watch } = require("../shared/src_index-tm1mV84P.cjs");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
6
|
exports.VERSION = VERSION;
|
|
7
7
|
exports.defineConfig = defineConfig;
|
|
8
8
|
exports.rolldown = rolldown;
|
|
9
|
+
exports.watch = watch;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
|
|
4
|
-
const { PluginContextData, bindingifyPlugin, require_binding } = require("../shared/src_index-
|
|
4
|
+
const { PluginContextData, bindingifyPlugin, require_binding } = require("../shared/src_index-tm1mV84P.cjs");
|
|
5
5
|
const { parentPort, workerData } = __toESM(require("node:worker_threads"));
|
|
6
6
|
|
|
7
7
|
//#region src/parallel-plugin-worker.ts
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, __export, arraify, description, rolldown, version } from "../shared/src_index-
|
|
3
|
+
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src_index-_6D8oVEl.mjs";
|
|
4
4
|
import { createConsola } from "../shared/consola.36c0034f-Xyw7SC_7.mjs";
|
|
5
5
|
import { default as nodePath } from "node:path";
|
|
6
6
|
import { ZodFirstPartyTypeKind, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$1, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$2, z, z as z$1, z as z$2, z as z$3 } from "zod";
|
|
@@ -122,13 +122,13 @@ async function bundleWithConfig(configPath, cliOptions) {
|
|
|
122
122
|
}
|
|
123
123
|
const configList = arraify(config);
|
|
124
124
|
for (const config$1 of configList) {
|
|
125
|
-
await bundleInner(config$1, cliOptions);
|
|
125
|
+
cliOptions.watch ? await watchInner(config$1, cliOptions) : bundleInner(config$1, cliOptions);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
async function bundleWithCliOptions(cliOptions) {
|
|
129
129
|
if (cliOptions.output.dir) {
|
|
130
|
-
await bundleInner({}, cliOptions);
|
|
131
|
-
} else {
|
|
130
|
+
cliOptions.watch ? await watchInner({}, cliOptions) : await bundleInner({}, cliOptions);
|
|
131
|
+
} else if (!cliOptions.watch) {
|
|
132
132
|
const build = await rolldown(cliOptions.input);
|
|
133
133
|
const { output: output } = await build.generate(cliOptions.output);
|
|
134
134
|
if (output.length > 1) {
|
|
@@ -140,8 +140,18 @@ async function bundleWithCliOptions(cliOptions) {
|
|
|
140
140
|
} else {
|
|
141
141
|
logger.log(output[0].code);
|
|
142
142
|
}
|
|
143
|
+
} else {
|
|
144
|
+
logger.error("You must specify `output.dir` to use watch mode");
|
|
145
|
+
process.exit(1);
|
|
143
146
|
}
|
|
144
147
|
}
|
|
148
|
+
async function watchInner(options$1, cliOptions) {
|
|
149
|
+
await watch({
|
|
150
|
+
...options$1,
|
|
151
|
+
...cliOptions.input
|
|
152
|
+
});
|
|
153
|
+
logger.log(`Waiting for changes...`);
|
|
154
|
+
}
|
|
145
155
|
async function bundleInner(options$1, cliOptions) {
|
|
146
156
|
const startTime = performance.now();
|
|
147
157
|
const build = await rolldown({
|
|
@@ -1416,7 +1426,8 @@ const outputCliOptionsSchema = (outputOptionsSchema.extend({
|
|
|
1416
1426
|
const cliOptionsSchema = ((z.strictObject({
|
|
1417
1427
|
config: (((z.string()).or(z.boolean())).describe("Path to the config file (default: `rolldown.config.js`)")).optional(),
|
|
1418
1428
|
help: ((z.boolean()).describe("Show help")).optional(),
|
|
1419
|
-
version: ((z.boolean()).describe("Show version number")).optional()
|
|
1429
|
+
version: ((z.boolean()).describe("Show version number")).optional(),
|
|
1430
|
+
watch: ((z.boolean()).describe("Watch files in bundle and rebuild on changes")).optional()
|
|
1420
1431
|
})).merge(inputCliOptionsSchema)).merge(outputCliOptionsSchema);
|
|
1421
1432
|
const schema = zodToJsonSchema(cliOptionsSchema);
|
|
1422
1433
|
|
|
@@ -1430,6 +1441,7 @@ const alias = {
|
|
|
1430
1441
|
},
|
|
1431
1442
|
help: {abbreviation: "h"},
|
|
1432
1443
|
version: {abbreviation: "v"},
|
|
1444
|
+
watch: {abbreviation: "w"},
|
|
1433
1445
|
dir: {abbreviation: "d"},
|
|
1434
1446
|
external: {abbreviation: "e"},
|
|
1435
1447
|
format: {abbreviation: "f"},
|
|
@@ -1519,12 +1531,13 @@ function normalizeCliOptions(cliOptions, positionals) {
|
|
|
1519
1531
|
input: {},
|
|
1520
1532
|
output: {},
|
|
1521
1533
|
help: options$1.help ?? false,
|
|
1522
|
-
version: options$1.version ?? false
|
|
1534
|
+
version: options$1.version ?? false,
|
|
1535
|
+
watch: options$1.watch ?? false
|
|
1523
1536
|
};
|
|
1524
1537
|
if (typeof options$1.config === "string") {
|
|
1525
1538
|
result.config = options$1.config ? options$1.config : "rolldown.config.js";
|
|
1526
1539
|
}
|
|
1527
|
-
const reservedKeys = ["help", "version", "config"];
|
|
1540
|
+
const reservedKeys = ["help", "version", "config", "watch"];
|
|
1528
1541
|
const keysOfInput = (inputCliOptionsSchema.keyof())._def.values;
|
|
1529
1542
|
const keysOfOutput = (outputCliOptionsSchema.keyof())._def.values;
|
|
1530
1543
|
for (let [key, value] of Object.entries(options$1)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { __toESM, aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src_index-
|
|
3
|
+
import { __toESM, aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src_index-_6D8oVEl.mjs";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
|
|
6
6
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { VERSION, defineConfig, rolldown } from "../shared/src_index-
|
|
3
|
+
import { VERSION, defineConfig, rolldown, watch } from "../shared/src_index-_6D8oVEl.mjs";
|
|
4
4
|
|
|
5
|
-
export { VERSION, defineConfig, rolldown };
|
|
5
|
+
export { VERSION, defineConfig, rolldown, watch };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src_index-
|
|
3
|
+
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src_index-_6D8oVEl.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -95,73 +95,73 @@ function __napi_rs_initialize_modules(__napiInstance) {
|
|
|
95
95
|
__napiInstance.exports['__napi_register__isolated_declaration_0']?.()
|
|
96
96
|
__napiInstance.exports['__napi_register__transform_1']?.()
|
|
97
97
|
__napiInstance.exports['__napi_register__Bundler_struct_0']?.()
|
|
98
|
-
__napiInstance.exports['
|
|
99
|
-
__napiInstance.exports['
|
|
100
|
-
__napiInstance.exports['
|
|
101
|
-
__napiInstance.exports['
|
|
102
|
-
__napiInstance.exports['
|
|
103
|
-
__napiInstance.exports['
|
|
104
|
-
__napiInstance.exports['
|
|
105
|
-
__napiInstance.exports['
|
|
106
|
-
__napiInstance.exports['
|
|
107
|
-
__napiInstance.exports['
|
|
108
|
-
__napiInstance.exports['
|
|
109
|
-
__napiInstance.exports['
|
|
110
|
-
__napiInstance.exports['
|
|
111
|
-
__napiInstance.exports['
|
|
112
|
-
__napiInstance.exports['
|
|
113
|
-
__napiInstance.exports['
|
|
114
|
-
__napiInstance.exports['
|
|
115
|
-
__napiInstance.exports['
|
|
116
|
-
__napiInstance.exports['
|
|
117
|
-
__napiInstance.exports['
|
|
118
|
-
__napiInstance.exports['
|
|
119
|
-
__napiInstance.exports['
|
|
120
|
-
__napiInstance.exports['
|
|
121
|
-
__napiInstance.exports['
|
|
122
|
-
__napiInstance.exports['
|
|
123
|
-
__napiInstance.exports['
|
|
124
|
-
__napiInstance.exports['
|
|
125
|
-
__napiInstance.exports['
|
|
126
|
-
__napiInstance.exports['
|
|
127
|
-
__napiInstance.exports['
|
|
128
|
-
__napiInstance.exports['
|
|
129
|
-
__napiInstance.exports['
|
|
130
|
-
__napiInstance.exports['
|
|
131
|
-
__napiInstance.exports['
|
|
132
|
-
__napiInstance.exports['
|
|
133
|
-
__napiInstance.exports['
|
|
134
|
-
__napiInstance.exports['
|
|
135
|
-
__napiInstance.exports['
|
|
136
|
-
__napiInstance.exports['
|
|
137
|
-
__napiInstance.exports['
|
|
138
|
-
__napiInstance.exports['
|
|
139
|
-
__napiInstance.exports['
|
|
140
|
-
__napiInstance.exports['
|
|
141
|
-
__napiInstance.exports['
|
|
142
|
-
__napiInstance.exports['
|
|
143
|
-
__napiInstance.exports['
|
|
144
|
-
__napiInstance.exports['
|
|
145
|
-
__napiInstance.exports['
|
|
146
|
-
__napiInstance.exports['
|
|
147
|
-
__napiInstance.exports['
|
|
148
|
-
__napiInstance.exports['
|
|
149
|
-
__napiInstance.exports['
|
|
150
|
-
__napiInstance.exports['
|
|
151
|
-
__napiInstance.exports['
|
|
152
|
-
__napiInstance.exports['
|
|
153
|
-
__napiInstance.exports['
|
|
154
|
-
__napiInstance.exports['
|
|
155
|
-
__napiInstance.exports['
|
|
156
|
-
__napiInstance.exports['
|
|
157
|
-
__napiInstance.exports['
|
|
158
|
-
__napiInstance.exports['
|
|
159
|
-
__napiInstance.exports['
|
|
160
|
-
__napiInstance.exports['
|
|
161
|
-
__napiInstance.exports['
|
|
162
|
-
__napiInstance.exports['
|
|
163
|
-
__napiInstance.exports['
|
|
164
|
-
__napiInstance.exports['
|
|
98
|
+
__napiInstance.exports['__napi_register__Bundler_impl_7']?.()
|
|
99
|
+
__napiInstance.exports['__napi_register__BindingExperimentalOptions_struct_8']?.()
|
|
100
|
+
__napiInstance.exports['__napi_register__BindingInjectImportNamed_struct_9']?.()
|
|
101
|
+
__napiInstance.exports['__napi_register__BindingInjectImportNamespace_struct_10']?.()
|
|
102
|
+
__napiInstance.exports['__napi_register__BindingInputItem_struct_11']?.()
|
|
103
|
+
__napiInstance.exports['__napi_register__BindingResolveOptions_struct_12']?.()
|
|
104
|
+
__napiInstance.exports['__napi_register__BindingTreeshake_struct_13']?.()
|
|
105
|
+
__napiInstance.exports['__napi_register__BindingInputOptions_struct_14']?.()
|
|
106
|
+
__napiInstance.exports['__napi_register__BindingAdvancedChunksOptions_struct_15']?.()
|
|
107
|
+
__napiInstance.exports['__napi_register__BindingMatchGroup_struct_16']?.()
|
|
108
|
+
__napiInstance.exports['__napi_register__BindingOutputOptions_struct_17']?.()
|
|
109
|
+
__napiInstance.exports['__napi_register__BindingPluginContext_struct_18']?.()
|
|
110
|
+
__napiInstance.exports['__napi_register__BindingPluginContext_impl_24']?.()
|
|
111
|
+
__napiInstance.exports['__napi_register__BindingPluginContextResolvedId_struct_25']?.()
|
|
112
|
+
__napiInstance.exports['__napi_register__BindingPluginOptions_struct_26']?.()
|
|
113
|
+
__napiInstance.exports['__napi_register__BindingPluginWithIndex_struct_27']?.()
|
|
114
|
+
__napiInstance.exports['__napi_register__BindingTransformPluginContext_struct_28']?.()
|
|
115
|
+
__napiInstance.exports['__napi_register__BindingTransformPluginContext_impl_30']?.()
|
|
116
|
+
__napiInstance.exports['__napi_register__BindingAssetSource_struct_31']?.()
|
|
117
|
+
__napiInstance.exports['__napi_register__BindingEmittedAsset_struct_32']?.()
|
|
118
|
+
__napiInstance.exports['__napi_register__BindingGeneralHookFilter_struct_33']?.()
|
|
119
|
+
__napiInstance.exports['__napi_register__BindingTransformHookFilter_struct_34']?.()
|
|
120
|
+
__napiInstance.exports['__napi_register__BindingHookLoadOutput_struct_35']?.()
|
|
121
|
+
__napiInstance.exports['__napi_register__BindingHookRenderChunkOutput_struct_36']?.()
|
|
122
|
+
__napiInstance.exports['__napi_register__BindingHookResolveIdExtraArgs_struct_37']?.()
|
|
123
|
+
__napiInstance.exports['__napi_register__BindingHookResolveIdOutput_struct_38']?.()
|
|
124
|
+
__napiInstance.exports['__napi_register__BindingHookSideEffects_39']?.()
|
|
125
|
+
__napiInstance.exports['__napi_register__BindingHookTransformOutput_struct_40']?.()
|
|
126
|
+
__napiInstance.exports['__napi_register__BindingStringOrRegex_struct_41']?.()
|
|
127
|
+
__napiInstance.exports['__napi_register__BindingPluginContextResolveOptions_struct_42']?.()
|
|
128
|
+
__napiInstance.exports['__napi_register__BindingTransformHookExtraArgs_struct_43']?.()
|
|
129
|
+
__napiInstance.exports['__napi_register__BindingBuiltinPlugin_struct_44']?.()
|
|
130
|
+
__napiInstance.exports['__napi_register__BindingBuiltinPluginName_45']?.()
|
|
131
|
+
__napiInstance.exports['__napi_register__BindingGlobImportPluginConfig_struct_46']?.()
|
|
132
|
+
__napiInstance.exports['__napi_register__BindingManifestPluginConfig_struct_47']?.()
|
|
133
|
+
__napiInstance.exports['__napi_register__BindingModulePreloadPolyfillPluginConfig_struct_48']?.()
|
|
134
|
+
__napiInstance.exports['__napi_register__BindingJsonPluginConfig_struct_49']?.()
|
|
135
|
+
__napiInstance.exports['__napi_register__BindingTransformPluginConfig_struct_50']?.()
|
|
136
|
+
__napiInstance.exports['__napi_register__BindingAliasPluginConfig_struct_51']?.()
|
|
137
|
+
__napiInstance.exports['__napi_register__BindingAliasPluginAlias_struct_52']?.()
|
|
138
|
+
__napiInstance.exports['__napi_register__BindingBuildImportAnalysisPluginConfig_struct_53']?.()
|
|
139
|
+
__napiInstance.exports['__napi_register__BindingReplacePluginConfig_struct_54']?.()
|
|
140
|
+
__napiInstance.exports['__napi_register__BindingPluginOrder_55']?.()
|
|
141
|
+
__napiInstance.exports['__napi_register__BindingPluginHookMeta_struct_56']?.()
|
|
142
|
+
__napiInstance.exports['__napi_register__ParallelJsPluginRegistry_struct_57']?.()
|
|
143
|
+
__napiInstance.exports['__napi_register__ParallelJsPluginRegistry_impl_59']?.()
|
|
144
|
+
__napiInstance.exports['__napi_register__register_plugins_60']?.()
|
|
145
|
+
__napiInstance.exports['__napi_register__BindingLog_struct_61']?.()
|
|
146
|
+
__napiInstance.exports['__napi_register__BindingLogLevel_62']?.()
|
|
147
|
+
__napiInstance.exports['__napi_register__BindingModuleInfo_struct_63']?.()
|
|
148
|
+
__napiInstance.exports['__napi_register__BindingModuleInfo_impl_65']?.()
|
|
149
|
+
__napiInstance.exports['__napi_register__BindingOutputAsset_struct_66']?.()
|
|
150
|
+
__napiInstance.exports['__napi_register__BindingOutputAsset_impl_71']?.()
|
|
151
|
+
__napiInstance.exports['__napi_register__JsOutputAsset_struct_72']?.()
|
|
152
|
+
__napiInstance.exports['__napi_register__BindingOutputChunk_struct_73']?.()
|
|
153
|
+
__napiInstance.exports['__napi_register__BindingOutputChunk_impl_88']?.()
|
|
154
|
+
__napiInstance.exports['__napi_register__JsOutputChunk_struct_89']?.()
|
|
155
|
+
__napiInstance.exports['__napi_register__BindingOutputs_struct_90']?.()
|
|
156
|
+
__napiInstance.exports['__napi_register__BindingOutputs_impl_93']?.()
|
|
157
|
+
__napiInstance.exports['__napi_register__JsChangedOutputs_struct_94']?.()
|
|
158
|
+
__napiInstance.exports['__napi_register__PreRenderedChunk_struct_95']?.()
|
|
159
|
+
__napiInstance.exports['__napi_register__RenderedChunk_struct_96']?.()
|
|
160
|
+
__napiInstance.exports['__napi_register__BindingRenderedModule_struct_97']?.()
|
|
161
|
+
__napiInstance.exports['__napi_register__AliasItem_struct_98']?.()
|
|
162
|
+
__napiInstance.exports['__napi_register__ExtensionAliasItem_struct_99']?.()
|
|
163
|
+
__napiInstance.exports['__napi_register__BindingSourcemap_struct_100']?.()
|
|
164
|
+
__napiInstance.exports['__napi_register__BindingJsonSourcemap_struct_101']?.()
|
|
165
165
|
}
|
|
166
166
|
module.exports.BindingLog = __napiModule.exports.BindingLog
|
|
167
167
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
@@ -1516,6 +1516,22 @@ function bindingifyOutro(plugin, options, pluginContextData) {
|
|
|
1516
1516
|
};
|
|
1517
1517
|
}
|
|
1518
1518
|
|
|
1519
|
+
//#endregion
|
|
1520
|
+
//#region src/plugin/bindingify-watch-hooks.ts
|
|
1521
|
+
function bindingifyWatchChange(plugin, options, pluginContextData) {
|
|
1522
|
+
const hook = plugin.watchChange;
|
|
1523
|
+
if (!hook) {
|
|
1524
|
+
return {};
|
|
1525
|
+
}
|
|
1526
|
+
const { handler: handler, meta: meta } = normalizeHook(hook);
|
|
1527
|
+
return {
|
|
1528
|
+
plugin: async (ctx, id, event) => {
|
|
1529
|
+
await handler.call(new PluginContext(options, ctx, plugin, pluginContextData), id, {event: event});
|
|
1530
|
+
},
|
|
1531
|
+
meta: bindingifyPluginHookMeta(meta)
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1519
1535
|
//#endregion
|
|
1520
1536
|
//#region src/plugin/bindingify-plugin.ts
|
|
1521
1537
|
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
@@ -1537,6 +1553,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1537
1553
|
const { plugin: footer, meta: footerMeta } = bindingifyFooter(plugin, options, pluginContextData);
|
|
1538
1554
|
const { plugin: intro, meta: introMeta } = bindingifyIntro(plugin, options, pluginContextData);
|
|
1539
1555
|
const { plugin: outro, meta: outroMeta } = bindingifyOutro(plugin, options, pluginContextData);
|
|
1556
|
+
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(plugin, options, pluginContextData);
|
|
1540
1557
|
return {
|
|
1541
1558
|
name: plugin.name ?? "unknown",
|
|
1542
1559
|
buildStart,
|
|
@@ -1577,7 +1594,9 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1577
1594
|
intro,
|
|
1578
1595
|
introMeta,
|
|
1579
1596
|
outro,
|
|
1580
|
-
outroMeta
|
|
1597
|
+
outroMeta,
|
|
1598
|
+
watchChange,
|
|
1599
|
+
watchChangeMeta
|
|
1581
1600
|
};
|
|
1582
1601
|
}
|
|
1583
1602
|
|
|
@@ -2090,7 +2109,7 @@ function t(...n) {
|
|
|
2090
2109
|
|
|
2091
2110
|
//#endregion
|
|
2092
2111
|
//#region src/constants/plugin.ts
|
|
2093
|
-
const ENUMERATED_PLUGIN_HOOK_NAMES = ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle",];
|
|
2112
|
+
const ENUMERATED_PLUGIN_HOOK_NAMES = ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle", "watchChange",];
|
|
2094
2113
|
const DEFINED_HOOK_NAMES = {
|
|
2095
2114
|
[ENUMERATED_PLUGIN_HOOK_NAMES[0]]: ENUMERATED_PLUGIN_HOOK_NAMES[0],
|
|
2096
2115
|
[ENUMERATED_PLUGIN_HOOK_NAMES[1]]: ENUMERATED_PLUGIN_HOOK_NAMES[1],
|
|
@@ -2112,7 +2131,8 @@ const DEFINED_HOOK_NAMES = {
|
|
|
2112
2131
|
[ENUMERATED_PLUGIN_HOOK_NAMES[17]]: ENUMERATED_PLUGIN_HOOK_NAMES[17],
|
|
2113
2132
|
[ENUMERATED_PLUGIN_HOOK_NAMES[18]]: ENUMERATED_PLUGIN_HOOK_NAMES[18],
|
|
2114
2133
|
[ENUMERATED_PLUGIN_HOOK_NAMES[19]]: ENUMERATED_PLUGIN_HOOK_NAMES[19],
|
|
2115
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[20]]: ENUMERATED_PLUGIN_HOOK_NAMES[20]
|
|
2134
|
+
[ENUMERATED_PLUGIN_HOOK_NAMES[20]]: ENUMERATED_PLUGIN_HOOK_NAMES[20],
|
|
2135
|
+
[ENUMERATED_PLUGIN_HOOK_NAMES[21]]: ENUMERATED_PLUGIN_HOOK_NAMES[21]
|
|
2116
2136
|
};
|
|
2117
2137
|
|
|
2118
2138
|
//#endregion
|
|
@@ -2212,6 +2232,14 @@ function createComposedPlugin(plugins) {
|
|
|
2212
2232
|
}
|
|
2213
2233
|
break;
|
|
2214
2234
|
}
|
|
2235
|
+
case "watchChange": {
|
|
2236
|
+
const handlers = batchedHooks.watchChange ?? [];
|
|
2237
|
+
batchedHooks.watchChange = handlers;
|
|
2238
|
+
if (plugin.watchChange) {
|
|
2239
|
+
handlers.push([plugin.watchChange, plugin]);
|
|
2240
|
+
}
|
|
2241
|
+
break;
|
|
2242
|
+
}
|
|
2215
2243
|
default: {}
|
|
2216
2244
|
}
|
|
2217
2245
|
});
|
|
@@ -2384,6 +2412,18 @@ function createComposedPlugin(plugins) {
|
|
|
2384
2412
|
}
|
|
2385
2413
|
break;
|
|
2386
2414
|
}
|
|
2415
|
+
case "watchChange": {
|
|
2416
|
+
if (batchedHooks.watchChange) {
|
|
2417
|
+
const batchedHandlers = batchedHooks.watchChange;
|
|
2418
|
+
composed.watchChange = async function(id, event) {
|
|
2419
|
+
await Promise.all(batchedHandlers.map(([handler, plugin]) => {
|
|
2420
|
+
const { handler: handlerFn } = normalizeHook(handler);
|
|
2421
|
+
return handlerFn.call(applyFixedPluginResolveFn(this, plugin), id, event);
|
|
2422
|
+
}));
|
|
2423
|
+
};
|
|
2424
|
+
}
|
|
2425
|
+
break;
|
|
2426
|
+
}
|
|
2387
2427
|
default: {}
|
|
2388
2428
|
}
|
|
2389
2429
|
});
|
|
@@ -2632,6 +2672,10 @@ class RolldownBuild {
|
|
|
2632
2672
|
await this.#stopWorkers?.();
|
|
2633
2673
|
await bundler.close();
|
|
2634
2674
|
}
|
|
2675
|
+
async watch() {
|
|
2676
|
+
const bundler = await this.#getBundler({});
|
|
2677
|
+
await bundler.watch();
|
|
2678
|
+
}
|
|
2635
2679
|
}
|
|
2636
2680
|
|
|
2637
2681
|
//#endregion
|
|
@@ -2639,6 +2683,9 @@ class RolldownBuild {
|
|
|
2639
2683
|
const rolldown = async (input) => {
|
|
2640
2684
|
return new RolldownBuild(input);
|
|
2641
2685
|
};
|
|
2686
|
+
const watch = async (input) => {
|
|
2687
|
+
(new RolldownBuild(input)).watch();
|
|
2688
|
+
};
|
|
2642
2689
|
const experimental_scan = async (input) => {
|
|
2643
2690
|
const { bundler: bundler, stopWorkers: stopWorkers } = await createBundler(input, {});
|
|
2644
2691
|
await bundler.scan();
|
|
@@ -2655,4 +2702,4 @@ const description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-comp
|
|
|
2655
2702
|
const VERSION = version;
|
|
2656
2703
|
|
|
2657
2704
|
//#endregion
|
|
2658
|
-
export { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, PluginContextData, RollupLogSchema, RollupLogWithStringSchema, VERSION, __export, __toESM, aliasPlugin, arraify, bindingifyPlugin, buildImportAnalysisPlugin, composeJsPlugins, defineConfig, description, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, rolldown, transformPlugin, version, wasmFallbackPlugin, wasmHelperPlugin };
|
|
2705
|
+
export { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, PluginContextData, RollupLogSchema, RollupLogWithStringSchema, VERSION, __export, __toESM, aliasPlugin, arraify, bindingifyPlugin, buildImportAnalysisPlugin, composeJsPlugins, defineConfig, description, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, rolldown, transformPlugin, version, wasmFallbackPlugin, wasmHelperPlugin, watch };
|
|
@@ -1485,6 +1485,22 @@ function bindingifyOutro(plugin, options, pluginContextData) {
|
|
|
1485
1485
|
};
|
|
1486
1486
|
}
|
|
1487
1487
|
|
|
1488
|
+
//#endregion
|
|
1489
|
+
//#region src/plugin/bindingify-watch-hooks.ts
|
|
1490
|
+
function bindingifyWatchChange(plugin, options, pluginContextData) {
|
|
1491
|
+
const hook = plugin.watchChange;
|
|
1492
|
+
if (!hook) {
|
|
1493
|
+
return {};
|
|
1494
|
+
}
|
|
1495
|
+
const { handler: handler, meta: meta } = normalizeHook(hook);
|
|
1496
|
+
return {
|
|
1497
|
+
plugin: async (ctx, id, event) => {
|
|
1498
|
+
await handler.call(new PluginContext(options, ctx, plugin, pluginContextData), id, {event: event});
|
|
1499
|
+
},
|
|
1500
|
+
meta: bindingifyPluginHookMeta(meta)
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1488
1504
|
//#endregion
|
|
1489
1505
|
//#region src/plugin/bindingify-plugin.ts
|
|
1490
1506
|
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
@@ -1506,6 +1522,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1506
1522
|
const { plugin: footer, meta: footerMeta } = bindingifyFooter(plugin, options, pluginContextData);
|
|
1507
1523
|
const { plugin: intro, meta: introMeta } = bindingifyIntro(plugin, options, pluginContextData);
|
|
1508
1524
|
const { plugin: outro, meta: outroMeta } = bindingifyOutro(plugin, options, pluginContextData);
|
|
1525
|
+
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(plugin, options, pluginContextData);
|
|
1509
1526
|
return {
|
|
1510
1527
|
name: plugin.name ?? "unknown",
|
|
1511
1528
|
buildStart,
|
|
@@ -1546,7 +1563,9 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1546
1563
|
intro,
|
|
1547
1564
|
introMeta,
|
|
1548
1565
|
outro,
|
|
1549
|
-
outroMeta
|
|
1566
|
+
outroMeta,
|
|
1567
|
+
watchChange,
|
|
1568
|
+
watchChangeMeta
|
|
1550
1569
|
};
|
|
1551
1570
|
}
|
|
1552
1571
|
|
|
@@ -2059,7 +2078,7 @@ function t(...n) {
|
|
|
2059
2078
|
|
|
2060
2079
|
//#endregion
|
|
2061
2080
|
//#region src/constants/plugin.ts
|
|
2062
|
-
const ENUMERATED_PLUGIN_HOOK_NAMES = ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle",];
|
|
2081
|
+
const ENUMERATED_PLUGIN_HOOK_NAMES = ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle", "watchChange",];
|
|
2063
2082
|
const DEFINED_HOOK_NAMES = {
|
|
2064
2083
|
[ENUMERATED_PLUGIN_HOOK_NAMES[0]]: ENUMERATED_PLUGIN_HOOK_NAMES[0],
|
|
2065
2084
|
[ENUMERATED_PLUGIN_HOOK_NAMES[1]]: ENUMERATED_PLUGIN_HOOK_NAMES[1],
|
|
@@ -2081,7 +2100,8 @@ const DEFINED_HOOK_NAMES = {
|
|
|
2081
2100
|
[ENUMERATED_PLUGIN_HOOK_NAMES[17]]: ENUMERATED_PLUGIN_HOOK_NAMES[17],
|
|
2082
2101
|
[ENUMERATED_PLUGIN_HOOK_NAMES[18]]: ENUMERATED_PLUGIN_HOOK_NAMES[18],
|
|
2083
2102
|
[ENUMERATED_PLUGIN_HOOK_NAMES[19]]: ENUMERATED_PLUGIN_HOOK_NAMES[19],
|
|
2084
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[20]]: ENUMERATED_PLUGIN_HOOK_NAMES[20]
|
|
2103
|
+
[ENUMERATED_PLUGIN_HOOK_NAMES[20]]: ENUMERATED_PLUGIN_HOOK_NAMES[20],
|
|
2104
|
+
[ENUMERATED_PLUGIN_HOOK_NAMES[21]]: ENUMERATED_PLUGIN_HOOK_NAMES[21]
|
|
2085
2105
|
};
|
|
2086
2106
|
|
|
2087
2107
|
//#endregion
|
|
@@ -2181,6 +2201,14 @@ function createComposedPlugin(plugins) {
|
|
|
2181
2201
|
}
|
|
2182
2202
|
break;
|
|
2183
2203
|
}
|
|
2204
|
+
case "watchChange": {
|
|
2205
|
+
const handlers = batchedHooks.watchChange ?? [];
|
|
2206
|
+
batchedHooks.watchChange = handlers;
|
|
2207
|
+
if (plugin.watchChange) {
|
|
2208
|
+
handlers.push([plugin.watchChange, plugin]);
|
|
2209
|
+
}
|
|
2210
|
+
break;
|
|
2211
|
+
}
|
|
2184
2212
|
default: {}
|
|
2185
2213
|
}
|
|
2186
2214
|
});
|
|
@@ -2353,6 +2381,18 @@ function createComposedPlugin(plugins) {
|
|
|
2353
2381
|
}
|
|
2354
2382
|
break;
|
|
2355
2383
|
}
|
|
2384
|
+
case "watchChange": {
|
|
2385
|
+
if (batchedHooks.watchChange) {
|
|
2386
|
+
const batchedHandlers = batchedHooks.watchChange;
|
|
2387
|
+
composed.watchChange = async function(id, event) {
|
|
2388
|
+
await Promise.all(batchedHandlers.map(([handler, plugin]) => {
|
|
2389
|
+
const { handler: handlerFn } = normalizeHook(handler);
|
|
2390
|
+
return handlerFn.call(applyFixedPluginResolveFn(this, plugin), id, event);
|
|
2391
|
+
}));
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2394
|
+
break;
|
|
2395
|
+
}
|
|
2356
2396
|
default: {}
|
|
2357
2397
|
}
|
|
2358
2398
|
});
|
|
@@ -2601,6 +2641,10 @@ class RolldownBuild {
|
|
|
2601
2641
|
await this.#stopWorkers?.();
|
|
2602
2642
|
await bundler.close();
|
|
2603
2643
|
}
|
|
2644
|
+
async watch() {
|
|
2645
|
+
const bundler = await this.#getBundler({});
|
|
2646
|
+
await bundler.watch();
|
|
2647
|
+
}
|
|
2604
2648
|
}
|
|
2605
2649
|
|
|
2606
2650
|
//#endregion
|
|
@@ -2608,6 +2652,9 @@ class RolldownBuild {
|
|
|
2608
2652
|
const rolldown = async (input) => {
|
|
2609
2653
|
return new RolldownBuild(input);
|
|
2610
2654
|
};
|
|
2655
|
+
const watch = async (input) => {
|
|
2656
|
+
(new RolldownBuild(input)).watch();
|
|
2657
|
+
};
|
|
2611
2658
|
const experimental_scan = async (input) => {
|
|
2612
2659
|
const { bundler: bundler, stopWorkers: stopWorkers } = await createBundler(input, {});
|
|
2613
2660
|
await bundler.scan();
|
|
@@ -2652,4 +2699,5 @@ exports.transformPlugin = transformPlugin;
|
|
|
2652
2699
|
exports.version = version;
|
|
2653
2700
|
exports.wasmFallbackPlugin = wasmFallbackPlugin;
|
|
2654
2701
|
exports.wasmHelperPlugin = wasmHelperPlugin;
|
|
2702
|
+
exports.watch = watch;
|
|
2655
2703
|
|
package/dist/types/binding.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ export declare class Bundler {
|
|
|
63
63
|
generate(): Promise<BindingOutputs>
|
|
64
64
|
scan(): Promise<void>
|
|
65
65
|
close(): Promise<void>
|
|
66
|
+
watch(): Promise<void>
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
export declare class ParallelJsPluginRegistry {
|
|
@@ -341,6 +342,8 @@ export interface BindingPluginOptions {
|
|
|
341
342
|
writeBundleMeta?: BindingPluginHookMeta
|
|
342
343
|
closeBundle?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable>
|
|
343
344
|
closeBundleMeta?: BindingPluginHookMeta
|
|
345
|
+
watchChange?: (ctx: BindingPluginContext, path: string, event: string) => MaybePromise<VoidNullable>
|
|
346
|
+
watchChangeMeta?: BindingPluginHookMeta
|
|
344
347
|
banner?: (ctx: BindingPluginContext, chunk: RenderedChunk) => void
|
|
345
348
|
bannerMeta?: BindingPluginHookMeta
|
|
346
349
|
footer?: (ctx: BindingPluginContext, chunk: RenderedChunk) => void
|
|
@@ -751,3 +754,4 @@ export interface TypeScriptOptions {
|
|
|
751
754
|
*/
|
|
752
755
|
rewriteImportExtensions?: 'rewrite' | 'remove' | boolean
|
|
753
756
|
}
|
|
757
|
+
|
|
@@ -4,6 +4,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
4
4
|
config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
|
|
5
5
|
help: z.ZodOptional<z.ZodBoolean>;
|
|
6
6
|
version: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
watch: z.ZodOptional<z.ZodBoolean>;
|
|
7
8
|
}, Omit<z.objectUtil.extendShape<{
|
|
8
9
|
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
9
10
|
plugins: z.ZodOptional<z.ZodArray<z.ZodType<import("../../plugin").RolldownPluginRec, z.ZodTypeDef, import("../../plugin").RolldownPluginRec>, "many">>;
|
|
@@ -186,6 +187,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
186
187
|
minShareCount?: number | undefined;
|
|
187
188
|
} | undefined;
|
|
188
189
|
version?: boolean | undefined;
|
|
190
|
+
watch?: boolean | undefined;
|
|
189
191
|
config?: string | boolean | undefined;
|
|
190
192
|
help?: boolean | undefined;
|
|
191
193
|
}, {
|
|
@@ -221,6 +223,7 @@ export declare const cliOptionsSchema: z.ZodObject<z.objectUtil.extendShape<z.ob
|
|
|
221
223
|
minShareCount?: number | undefined;
|
|
222
224
|
} | undefined;
|
|
223
225
|
version?: boolean | undefined;
|
|
226
|
+
watch?: boolean | undefined;
|
|
224
227
|
config?: string | boolean | undefined;
|
|
225
228
|
help?: boolean | undefined;
|
|
226
229
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from '../plugin';
|
|
2
|
-
export declare const ENUMERATED_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle"];
|
|
2
|
+
export declare const ENUMERATED_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle", "watchChange"];
|
|
3
3
|
/**
|
|
4
4
|
* Names of all properties in a `Plugin` object. Includes `name` and `api`.
|
|
5
5
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { RolldownOptions } from './types/rolldown-options';
|
|
|
5
5
|
import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin';
|
|
6
6
|
import { DefineParallelPluginResult } from './plugin/parallel-plugin';
|
|
7
7
|
import { defineConfig } from './utils/define-config';
|
|
8
|
-
import { rolldown } from './rolldown';
|
|
8
|
+
import { rolldown, watch } from './rolldown';
|
|
9
9
|
import { ConfigExport } from './types/config-export';
|
|
10
10
|
import { RolldownBuild } from './rolldown-build';
|
|
11
11
|
import { EmittedAsset, EmittedFile, PluginContext } from './plugin/plugin-context';
|
|
@@ -18,7 +18,7 @@ import { ModuleInfo } from './types/module-info';
|
|
|
18
18
|
import { MinimalPluginContext } from './log/logger';
|
|
19
19
|
import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap';
|
|
20
20
|
import { OutputBundle } from './types/output-bundle';
|
|
21
|
-
export { defineConfig, rolldown };
|
|
21
|
+
export { defineConfig, rolldown, watch };
|
|
22
22
|
export declare const VERSION: string;
|
|
23
23
|
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, RenderedChunk, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, };
|
|
24
24
|
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BindingPluginOptions } from '../binding';
|
|
2
|
+
import type { NormalizedInputOptions } from '../options/normalized-input-options';
|
|
3
|
+
import type { Plugin } from './index';
|
|
4
|
+
import { PluginContextData } from './plugin-context-data';
|
|
5
|
+
import { PluginHookWithBindingExt } from './bindingify-plugin-hook-meta';
|
|
6
|
+
export declare function bindingifyWatchChange(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['watchChange']>;
|
|
@@ -77,7 +77,11 @@ export interface FunctionPluginHooks {
|
|
|
77
77
|
[DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
|
|
78
78
|
[DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
|
|
79
79
|
[DEFINED_HOOK_NAMES.closeBundle]: (this: PluginContext) => void;
|
|
80
|
+
[DEFINED_HOOK_NAMES.watchChange]: (this: PluginContext, id: string, event: {
|
|
81
|
+
event: ChangeEvent;
|
|
82
|
+
}) => void;
|
|
80
83
|
}
|
|
84
|
+
export type ChangeEvent = 'create' | 'update' | 'delete';
|
|
81
85
|
export type PluginOrder = 'pre' | 'post' | null;
|
|
82
86
|
export type ObjectHookMeta<O = {}> = {
|
|
83
87
|
order?: PluginOrder;
|
package/dist/types/rolldown.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { InputOptions } from './options/input-options';
|
|
2
2
|
import { RolldownBuild } from './rolldown-build';
|
|
3
3
|
export declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
|
|
4
|
+
export declare const watch: (input: InputOptions) => Promise<void>;
|
|
4
5
|
/**
|
|
5
6
|
* @description
|
|
6
7
|
* This is an experimental API. It's behavior may change in the future.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "0.13.2-snapshot-
|
|
3
|
+
"version": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -103,21 +103,21 @@
|
|
|
103
103
|
"why-is-node-running": "^3.0.0",
|
|
104
104
|
"zod-to-json-schema": "^3.23.2",
|
|
105
105
|
"@rolldown/testing": "0.0.1",
|
|
106
|
-
"rolldown": "0.13.2-snapshot-
|
|
106
|
+
"rolldown": "0.13.2-snapshot-bdde6fe-20241013003833"
|
|
107
107
|
},
|
|
108
108
|
"optionalDependencies": {
|
|
109
|
-
"@rolldown/binding-darwin-arm64": "0.13.2-snapshot-
|
|
110
|
-
"@rolldown/binding-darwin-x64": "0.13.2-snapshot-
|
|
111
|
-
"@rolldown/binding-
|
|
112
|
-
"@rolldown/binding-linux-
|
|
113
|
-
"@rolldown/binding-linux-
|
|
114
|
-
"@rolldown/binding-
|
|
115
|
-
"@rolldown/binding-
|
|
116
|
-
"@rolldown/binding-
|
|
117
|
-
"@rolldown/binding-linux-x64-musl": "0.13.2-snapshot-
|
|
118
|
-
"@rolldown/binding-win32-ia32-msvc": "0.13.2-snapshot-
|
|
119
|
-
"@rolldown/binding-win32-x64-msvc": "0.13.2-snapshot-
|
|
120
|
-
"@rolldown/binding-win32-arm64-msvc": "0.13.2-snapshot-
|
|
109
|
+
"@rolldown/binding-darwin-arm64": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
110
|
+
"@rolldown/binding-darwin-x64": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
111
|
+
"@rolldown/binding-linux-arm-gnueabihf": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
112
|
+
"@rolldown/binding-linux-arm64-musl": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
113
|
+
"@rolldown/binding-linux-x64-gnu": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
114
|
+
"@rolldown/binding-freebsd-x64": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
115
|
+
"@rolldown/binding-wasm32-wasi": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
116
|
+
"@rolldown/binding-linux-arm64-gnu": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
117
|
+
"@rolldown/binding-linux-x64-musl": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
118
|
+
"@rolldown/binding-win32-ia32-msvc": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
119
|
+
"@rolldown/binding-win32-x64-msvc": "0.13.2-snapshot-bdde6fe-20241013003833",
|
|
120
|
+
"@rolldown/binding-win32-arm64-msvc": "0.13.2-snapshot-bdde6fe-20241013003833"
|
|
121
121
|
},
|
|
122
122
|
"scripts": {
|
|
123
123
|
"# Scrips for binding #": "_",
|