rolldown 1.0.0-beta.7-commit.218ee9d → 1.0.0-beta.7-commit.7ddcaea
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 +3 -1
- package/dist/cjs/experimental-index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +4 -2
- package/dist/esm/cli.mjs +3 -1
- package/dist/esm/experimental-index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +4 -2
- package/dist/shared/{src-Cg4lpWN7.mjs → src-CRwPiE1a.mjs} +42 -41
- package/dist/shared/{src-B-DEVKvS.cjs → src-at1jEBX8.cjs} +42 -41
- package/dist/types/index.d.ts +2 -2
- package/dist/types/log/logger.d.ts +1 -1
- package/dist/types/plugin/bindingify-plugin.d.ts +2 -1
- package/dist/types/plugin/minimal-plugin-context.d.ts +1 -1
- package/dist/types/plugin/plugin-context.d.ts +1 -1
- package/dist/types/plugin/plugin-driver.d.ts +1 -1
- package/dist/types/plugin/transform-plugin-context.d.ts +1 -1
- package/dist/types/utils/bindingify-input-options.d.ts +1 -1
- package/dist/types/utils/create-bundler-option.d.ts +1 -1
- package/package.json +14 -14
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-at1jEBX8.cjs');
|
|
4
4
|
const require_parse_ast_index = require('../shared/parse-ast-index-BzS9mPhQ.cjs');
|
|
5
5
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
6
6
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
@@ -1317,6 +1317,8 @@ async function bundleWithCliOptions(cliOptions) {
|
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
1319
|
async function watchInner(config, cliOptions) {
|
|
1320
|
+
process.env.ROLLUP_WATCH = "true";
|
|
1321
|
+
process.env.ROLLDOWN_WATCH = "true";
|
|
1320
1322
|
let normalizedConfig = require_src.arraify(config).map((option) => {
|
|
1321
1323
|
return {
|
|
1322
1324
|
...option,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-at1jEBX8.cjs');
|
|
4
4
|
const require_parse_ast_index = require('../shared/parse-ast-index-BzS9mPhQ.cjs');
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
6
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-at1jEBX8.cjs');
|
|
4
4
|
const require_parse_ast_index = require('../shared/parse-ast-index-BzS9mPhQ.cjs');
|
|
5
5
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
6
6
|
|
|
@@ -22,7 +22,9 @@ const { registryId, pluginInfos, threadNumber } = node_worker_threads.workerData
|
|
|
22
22
|
new require_src.PluginContextData(),
|
|
23
23
|
[],
|
|
24
24
|
() => {},
|
|
25
|
-
"info"
|
|
25
|
+
"info",
|
|
26
|
+
// TODO: support this.meta.watchMode
|
|
27
|
+
false
|
|
26
28
|
)
|
|
27
29
|
};
|
|
28
30
|
}));
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { colors } from "../shared/parse-ast-index-CVCVLNV5.mjs";
|
|
2
|
-
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-
|
|
2
|
+
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-CRwPiE1a.mjs";
|
|
3
3
|
import process$1, { cwd } from "node:process";
|
|
4
4
|
import path, { sep } from "node:path";
|
|
5
5
|
import fs from "node:fs";
|
|
@@ -1313,6 +1313,8 @@ async function bundleWithCliOptions(cliOptions) {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
1315
|
async function watchInner(config, cliOptions) {
|
|
1316
|
+
process.env.ROLLUP_WATCH = "true";
|
|
1317
|
+
process.env.ROLLDOWN_WATCH = "true";
|
|
1316
1318
|
let normalizedConfig = arraify(config).map((option) => {
|
|
1317
1319
|
return {
|
|
1318
1320
|
...option,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { import_binding } from "../shared/parse-ast-index-CVCVLNV5.mjs";
|
|
2
|
-
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-
|
|
2
|
+
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-CRwPiE1a.mjs";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
|
|
5
5
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../shared/parse-ast-index-CVCVLNV5.mjs";
|
|
2
|
-
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-
|
|
2
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-CRwPiE1a.mjs";
|
|
3
3
|
|
|
4
4
|
export { VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { import_binding } from "../shared/parse-ast-index-CVCVLNV5.mjs";
|
|
2
|
-
import { PluginContextData, bindingifyPlugin } from "../shared/src-
|
|
2
|
+
import { PluginContextData, bindingifyPlugin } from "../shared/src-CRwPiE1a.mjs";
|
|
3
3
|
import { parentPort, workerData } from "node:worker_threads";
|
|
4
4
|
|
|
5
5
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -20,7 +20,9 @@ const { registryId, pluginInfos, threadNumber } = workerData;
|
|
|
20
20
|
new PluginContextData(),
|
|
21
21
|
[],
|
|
22
22
|
() => {},
|
|
23
|
-
"info"
|
|
23
|
+
"info",
|
|
24
|
+
// TODO: support this.meta.watchMode
|
|
25
|
+
false
|
|
24
26
|
)
|
|
25
27
|
};
|
|
26
28
|
}));
|
|
@@ -82,7 +82,7 @@ function normalizeHook(hook) {
|
|
|
82
82
|
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region src/log/logger.ts
|
|
85
|
-
function getLogger(plugins, onLog, logLevel) {
|
|
85
|
+
function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
86
86
|
const minimalPriority = logLevelPriority[logLevel];
|
|
87
87
|
const logger = (level, log, skipped = new Set()) => {
|
|
88
88
|
const logPriority = logLevelPriority[level];
|
|
@@ -103,7 +103,7 @@ function getLogger(plugins, onLog, logLevel) {
|
|
|
103
103
|
meta: {
|
|
104
104
|
rollupVersion: "4.23.0",
|
|
105
105
|
rolldownVersion: VERSION,
|
|
106
|
-
watchMode
|
|
106
|
+
watchMode
|
|
107
107
|
},
|
|
108
108
|
warn: getLogHandler$1(LOG_LEVEL_WARN),
|
|
109
109
|
pluginName: plugin.name || "unknown"
|
|
@@ -332,10 +332,10 @@ const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
|
|
|
332
332
|
//#endregion
|
|
333
333
|
//#region src/plugin/plugin-driver.ts
|
|
334
334
|
var PluginDriver = class {
|
|
335
|
-
static async callOptionsHook(inputOptions) {
|
|
335
|
+
static async callOptionsHook(inputOptions, watchMode = false) {
|
|
336
336
|
const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
|
|
337
337
|
const plugins = getSortedPlugins("options", getObjectPlugins(await normalizePluginOption(inputOptions.plugins)));
|
|
338
|
-
const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), logLevel);
|
|
338
|
+
const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), logLevel, watchMode);
|
|
339
339
|
for (const plugin of plugins) {
|
|
340
340
|
const name = plugin.name || "unknown";
|
|
341
341
|
const options = plugin.options;
|
|
@@ -348,7 +348,7 @@ var PluginDriver = class {
|
|
|
348
348
|
meta: {
|
|
349
349
|
rollupVersion: "4.23.0",
|
|
350
350
|
rolldownVersion: VERSION,
|
|
351
|
-
watchMode
|
|
351
|
+
watchMode
|
|
352
352
|
},
|
|
353
353
|
warn: getLogHandler(LOG_LEVEL_WARN, "PLUGIN_WARNING", logger, name, logLevel),
|
|
354
354
|
pluginName: name
|
|
@@ -1100,7 +1100,7 @@ var MinimalPluginContextImpl = class {
|
|
|
1100
1100
|
warn;
|
|
1101
1101
|
debug;
|
|
1102
1102
|
meta;
|
|
1103
|
-
constructor(onLog, logLevel, pluginName) {
|
|
1103
|
+
constructor(onLog, logLevel, pluginName, watchMode) {
|
|
1104
1104
|
this.pluginName = pluginName;
|
|
1105
1105
|
this.debug = getLogHandler(LOG_LEVEL_DEBUG, "PLUGIN_LOG", onLog, pluginName, logLevel);
|
|
1106
1106
|
this.info = getLogHandler(LOG_LEVEL_INFO, "PLUGIN_LOG", onLog, pluginName, logLevel);
|
|
@@ -1108,7 +1108,7 @@ var MinimalPluginContextImpl = class {
|
|
|
1108
1108
|
this.meta = {
|
|
1109
1109
|
rollupVersion: "4.23.0",
|
|
1110
1110
|
rolldownVersion: VERSION,
|
|
1111
|
-
watchMode
|
|
1111
|
+
watchMode
|
|
1112
1112
|
};
|
|
1113
1113
|
}
|
|
1114
1114
|
error(e) {
|
|
@@ -1151,8 +1151,8 @@ function bindingResolvedExternal(external) {
|
|
|
1151
1151
|
//#region src/plugin/plugin-context.ts
|
|
1152
1152
|
var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
1153
1153
|
getModuleInfo;
|
|
1154
|
-
constructor(outputOptions, context, plugin, data, onLog, logLevel, currentLoadingModule) {
|
|
1155
|
-
super(onLog, logLevel, plugin.name);
|
|
1154
|
+
constructor(outputOptions, context, plugin, data, onLog, logLevel, watchMode, currentLoadingModule) {
|
|
1155
|
+
super(onLog, logLevel, plugin.name, watchMode);
|
|
1156
1156
|
this.outputOptions = outputOptions;
|
|
1157
1157
|
this.context = context;
|
|
1158
1158
|
this.data = data;
|
|
@@ -1241,8 +1241,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
1241
1241
|
//#endregion
|
|
1242
1242
|
//#region src/plugin/transform-plugin-context.ts
|
|
1243
1243
|
var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
1244
|
-
constructor(outputOptions, context, plugin, data, inner, moduleId, moduleSource, onLog, LogLevelOption) {
|
|
1245
|
-
super(outputOptions, context, plugin, data, onLog, LogLevelOption, moduleId);
|
|
1244
|
+
constructor(outputOptions, context, plugin, data, inner, moduleId, moduleSource, onLog, LogLevelOption, watchMode) {
|
|
1245
|
+
super(outputOptions, context, plugin, data, onLog, LogLevelOption, watchMode, moduleId);
|
|
1246
1246
|
this.inner = inner;
|
|
1247
1247
|
this.moduleId = moduleId;
|
|
1248
1248
|
this.moduleSource = moduleSource;
|
|
@@ -1347,7 +1347,7 @@ function bindingifyBuildStart(args) {
|
|
|
1347
1347
|
const { handler, meta } = normalizeHook(hook);
|
|
1348
1348
|
return {
|
|
1349
1349
|
plugin: async (ctx, opts) => {
|
|
1350
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1350
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1351
1351
|
},
|
|
1352
1352
|
meta: bindingifyPluginHookMeta(meta)
|
|
1353
1353
|
};
|
|
@@ -1358,7 +1358,7 @@ function bindingifyBuildEnd(args) {
|
|
|
1358
1358
|
const { handler, meta } = normalizeHook(hook);
|
|
1359
1359
|
return {
|
|
1360
1360
|
plugin: async (ctx, err) => {
|
|
1361
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), err ? normalizeErrors(err) : void 0);
|
|
1361
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), err ? normalizeErrors(err) : void 0);
|
|
1362
1362
|
},
|
|
1363
1363
|
meta: bindingifyPluginHookMeta(meta)
|
|
1364
1364
|
};
|
|
@@ -1375,7 +1375,7 @@ function bindingifyResolveId(args) {
|
|
|
1375
1375
|
custom: contextResolveOptions?.custom,
|
|
1376
1376
|
[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]: contextResolveOptions?.[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]
|
|
1377
1377
|
};
|
|
1378
|
-
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), specifier, importer ?? void 0, newExtraOptions);
|
|
1378
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), specifier, importer ?? void 0, newExtraOptions);
|
|
1379
1379
|
if (ret == null) return;
|
|
1380
1380
|
if (ret === false) return {
|
|
1381
1381
|
id: specifier,
|
|
@@ -1408,7 +1408,7 @@ function bindingifyResolveDynamicImport(args) {
|
|
|
1408
1408
|
const { handler, meta } = normalizeHook(hook);
|
|
1409
1409
|
return {
|
|
1410
1410
|
plugin: async (ctx, specifier, importer) => {
|
|
1411
|
-
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), specifier, importer ?? void 0);
|
|
1411
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), specifier, importer ?? void 0);
|
|
1412
1412
|
if (ret == null) return;
|
|
1413
1413
|
if (ret === false) return {
|
|
1414
1414
|
id: specifier,
|
|
@@ -1436,7 +1436,7 @@ function bindingifyTransform(args) {
|
|
|
1436
1436
|
const { handler, meta, options } = normalizeHook(hook);
|
|
1437
1437
|
return {
|
|
1438
1438
|
plugin: async (ctx, code, id, meta$1) => {
|
|
1439
|
-
const ret = await handler.call(new TransformPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel), code, id, meta$1);
|
|
1439
|
+
const ret = await handler.call(new TransformPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel, args.watchMode), code, id, meta$1);
|
|
1440
1440
|
if (ret == null) return void 0;
|
|
1441
1441
|
if (typeof ret === "string") return { code: ret };
|
|
1442
1442
|
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
@@ -1461,7 +1461,7 @@ function bindingifyLoad(args) {
|
|
|
1461
1461
|
const { handler, meta, options } = normalizeHook(hook);
|
|
1462
1462
|
return {
|
|
1463
1463
|
plugin: async (ctx, id) => {
|
|
1464
|
-
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, id), id);
|
|
1464
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode, id), id);
|
|
1465
1465
|
if (ret == null) return;
|
|
1466
1466
|
if (typeof ret === "string") return { code: ret };
|
|
1467
1467
|
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
@@ -1497,7 +1497,7 @@ function bindingifyModuleParsed(args) {
|
|
|
1497
1497
|
const { handler, meta } = normalizeHook(hook);
|
|
1498
1498
|
return {
|
|
1499
1499
|
plugin: async (ctx, moduleInfo) => {
|
|
1500
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
|
|
1500
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
|
|
1501
1501
|
},
|
|
1502
1502
|
meta: bindingifyPluginHookMeta(meta)
|
|
1503
1503
|
};
|
|
@@ -1694,7 +1694,7 @@ function bindingifyRenderStart(args) {
|
|
|
1694
1694
|
const { handler, meta } = normalizeHook(hook);
|
|
1695
1695
|
return {
|
|
1696
1696
|
plugin: async (ctx, opts) => {
|
|
1697
|
-
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1697
|
+
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1698
1698
|
},
|
|
1699
1699
|
meta: bindingifyPluginHookMeta(meta)
|
|
1700
1700
|
};
|
|
@@ -1705,7 +1705,7 @@ function bindingifyRenderChunk(args) {
|
|
|
1705
1705
|
const { handler, meta } = normalizeHook(hook);
|
|
1706
1706
|
return {
|
|
1707
1707
|
plugin: async (ctx, code, chunk, opts, chunks) => {
|
|
1708
|
-
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), { chunks: Object.fromEntries(Object.entries(chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
|
|
1708
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), { chunks: Object.fromEntries(Object.entries(chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
|
|
1709
1709
|
if (ret == null) return;
|
|
1710
1710
|
if (typeof ret === "string") return { code: ret };
|
|
1711
1711
|
if (!ret.map) return { code: ret.code };
|
|
@@ -1723,7 +1723,7 @@ function bindingifyAugmentChunkHash(args) {
|
|
|
1723
1723
|
const { handler, meta } = normalizeHook(hook);
|
|
1724
1724
|
return {
|
|
1725
1725
|
plugin: async (ctx, chunk) => {
|
|
1726
|
-
return await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1726
|
+
return await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1727
1727
|
},
|
|
1728
1728
|
meta: bindingifyPluginHookMeta(meta)
|
|
1729
1729
|
};
|
|
@@ -1734,7 +1734,7 @@ function bindingifyRenderError(args) {
|
|
|
1734
1734
|
const { handler, meta } = normalizeHook(hook);
|
|
1735
1735
|
return {
|
|
1736
1736
|
plugin: async (ctx, err) => {
|
|
1737
|
-
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), normalizeErrors(err));
|
|
1737
|
+
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), normalizeErrors(err));
|
|
1738
1738
|
},
|
|
1739
1739
|
meta: bindingifyPluginHookMeta(meta)
|
|
1740
1740
|
};
|
|
@@ -1750,7 +1750,7 @@ function bindingifyGenerateBundle(args) {
|
|
|
1750
1750
|
deleted: new Set()
|
|
1751
1751
|
};
|
|
1752
1752
|
const output = transformToOutputBundle(bundle, changed);
|
|
1753
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output, isWrite);
|
|
1753
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output, isWrite);
|
|
1754
1754
|
return collectChangedBundle(changed, output);
|
|
1755
1755
|
},
|
|
1756
1756
|
meta: bindingifyPluginHookMeta(meta)
|
|
@@ -1767,7 +1767,7 @@ function bindingifyWriteBundle(args) {
|
|
|
1767
1767
|
deleted: new Set()
|
|
1768
1768
|
};
|
|
1769
1769
|
const output = transformToOutputBundle(bundle, changed);
|
|
1770
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output);
|
|
1770
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output);
|
|
1771
1771
|
return collectChangedBundle(changed, output);
|
|
1772
1772
|
},
|
|
1773
1773
|
meta: bindingifyPluginHookMeta(meta)
|
|
@@ -1779,7 +1779,7 @@ function bindingifyCloseBundle(args) {
|
|
|
1779
1779
|
const { handler, meta } = normalizeHook(hook);
|
|
1780
1780
|
return {
|
|
1781
1781
|
plugin: async (ctx) => {
|
|
1782
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel));
|
|
1782
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
|
|
1783
1783
|
},
|
|
1784
1784
|
meta: bindingifyPluginHookMeta(meta)
|
|
1785
1785
|
};
|
|
@@ -1791,7 +1791,7 @@ function bindingifyBanner(args) {
|
|
|
1791
1791
|
return {
|
|
1792
1792
|
plugin: async (ctx, chunk) => {
|
|
1793
1793
|
if (typeof handler === "string") return handler;
|
|
1794
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1794
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1795
1795
|
},
|
|
1796
1796
|
meta: bindingifyPluginHookMeta(meta)
|
|
1797
1797
|
};
|
|
@@ -1803,7 +1803,7 @@ function bindingifyFooter(args) {
|
|
|
1803
1803
|
return {
|
|
1804
1804
|
plugin: async (ctx, chunk) => {
|
|
1805
1805
|
if (typeof handler === "string") return handler;
|
|
1806
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1806
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1807
1807
|
},
|
|
1808
1808
|
meta: bindingifyPluginHookMeta(meta)
|
|
1809
1809
|
};
|
|
@@ -1815,7 +1815,7 @@ function bindingifyIntro(args) {
|
|
|
1815
1815
|
return {
|
|
1816
1816
|
plugin: async (ctx, chunk) => {
|
|
1817
1817
|
if (typeof handler === "string") return handler;
|
|
1818
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1818
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1819
1819
|
},
|
|
1820
1820
|
meta: bindingifyPluginHookMeta(meta)
|
|
1821
1821
|
};
|
|
@@ -1827,7 +1827,7 @@ function bindingifyOutro(args) {
|
|
|
1827
1827
|
return {
|
|
1828
1828
|
plugin: async (ctx, chunk) => {
|
|
1829
1829
|
if (typeof handler === "string") return handler;
|
|
1830
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1830
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1831
1831
|
},
|
|
1832
1832
|
meta: bindingifyPluginHookMeta(meta)
|
|
1833
1833
|
};
|
|
@@ -1841,7 +1841,7 @@ function bindingifyWatchChange(args) {
|
|
|
1841
1841
|
const { handler, meta } = normalizeHook(hook);
|
|
1842
1842
|
return {
|
|
1843
1843
|
plugin: async (ctx, id, event) => {
|
|
1844
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), id, { event });
|
|
1844
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), id, { event });
|
|
1845
1845
|
},
|
|
1846
1846
|
meta: bindingifyPluginHookMeta(meta)
|
|
1847
1847
|
};
|
|
@@ -1852,7 +1852,7 @@ function bindingifyCloseWatcher(args) {
|
|
|
1852
1852
|
const { handler, meta } = normalizeHook(hook);
|
|
1853
1853
|
return {
|
|
1854
1854
|
plugin: async (ctx) => {
|
|
1855
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel));
|
|
1855
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
|
|
1856
1856
|
},
|
|
1857
1857
|
meta: bindingifyPluginHookMeta(meta)
|
|
1858
1858
|
};
|
|
@@ -1860,7 +1860,7 @@ function bindingifyCloseWatcher(args) {
|
|
|
1860
1860
|
|
|
1861
1861
|
//#endregion
|
|
1862
1862
|
//#region src/plugin/bindingify-plugin.ts
|
|
1863
|
-
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel) {
|
|
1863
|
+
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
1864
1864
|
const args = {
|
|
1865
1865
|
plugin,
|
|
1866
1866
|
options,
|
|
@@ -1868,6 +1868,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1868
1868
|
pluginContextData,
|
|
1869
1869
|
onLog,
|
|
1870
1870
|
logLevel,
|
|
1871
|
+
watchMode,
|
|
1871
1872
|
normalizedOutputPlugins
|
|
1872
1873
|
};
|
|
1873
1874
|
const { plugin: buildStart, meta: buildStartMeta } = bindingifyBuildStart(args);
|
|
@@ -2058,12 +2059,12 @@ function normalizedStringOrRegex(pattern) {
|
|
|
2058
2059
|
|
|
2059
2060
|
//#endregion
|
|
2060
2061
|
//#region src/utils/bindingify-input-options.ts
|
|
2061
|
-
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel) {
|
|
2062
|
+
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
2062
2063
|
const pluginContextData = new PluginContextData();
|
|
2063
2064
|
const plugins = rawPlugins.map((plugin) => {
|
|
2064
2065
|
if ("_parallel" in plugin) return void 0;
|
|
2065
2066
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
2066
|
-
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel);
|
|
2067
|
+
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
2067
2068
|
});
|
|
2068
2069
|
return {
|
|
2069
2070
|
input: bindingifyInput(inputOptions.input),
|
|
@@ -2633,11 +2634,11 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
|
|
|
2633
2634
|
|
|
2634
2635
|
//#endregion
|
|
2635
2636
|
//#region src/utils/create-bundler-option.ts
|
|
2636
|
-
async function createBundlerOptions(inputOptions, outputOptions, isClose) {
|
|
2637
|
+
async function createBundlerOptions(inputOptions, outputOptions, watchMode, isClose) {
|
|
2637
2638
|
const inputPlugins = await normalizePluginOption(inputOptions.plugins);
|
|
2638
2639
|
const outputPlugins = await normalizePluginOption(outputOptions.plugins);
|
|
2639
2640
|
const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
|
|
2640
|
-
const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel);
|
|
2641
|
+
const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel, watchMode);
|
|
2641
2642
|
if (!isClose) outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions);
|
|
2642
2643
|
if (outputOptions.minify === true) onLog(LOG_LEVEL_WARN, logMinifyWarning());
|
|
2643
2644
|
const normalizedOutputPlugins = await normalizePluginOption(outputOptions.plugins);
|
|
@@ -2645,7 +2646,7 @@ async function createBundlerOptions(inputOptions, outputOptions, isClose) {
|
|
|
2645
2646
|
if (inputOptions.experimental?.enableComposingJsPlugins ?? false) plugins = composeJsPlugins(plugins);
|
|
2646
2647
|
const parallelPluginInitResult = await initializeParallelPlugins(plugins);
|
|
2647
2648
|
try {
|
|
2648
|
-
const bindingInputOptions = bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel);
|
|
2649
|
+
const bindingInputOptions = bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
2649
2650
|
const bindingOutputOptions = bindingifyOutputOptions(outputOptions);
|
|
2650
2651
|
return {
|
|
2651
2652
|
bundlerOptions: {
|
|
@@ -2667,7 +2668,7 @@ async function createBundlerOptions(inputOptions, outputOptions, isClose) {
|
|
|
2667
2668
|
//#region src/utils/create-bundler.ts
|
|
2668
2669
|
let asyncRuntimeShutdown = false;
|
|
2669
2670
|
async function createBundler(inputOptions, outputOptions, isClose) {
|
|
2670
|
-
const option = await createBundlerOptions(inputOptions, outputOptions, isClose);
|
|
2671
|
+
const option = await createBundlerOptions(inputOptions, outputOptions, false, isClose);
|
|
2671
2672
|
if (asyncRuntimeShutdown) (0, import_binding.startAsyncRuntime)();
|
|
2672
2673
|
try {
|
|
2673
2674
|
return {
|
|
@@ -2830,8 +2831,8 @@ var Watcher = class {
|
|
|
2830
2831
|
async function createWatcher(emitter, input) {
|
|
2831
2832
|
const options = arraify(input);
|
|
2832
2833
|
const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
|
|
2833
|
-
const inputOptions = await PluginDriver.callOptionsHook(option);
|
|
2834
|
-
return createBundlerOptions(inputOptions, output);
|
|
2834
|
+
const inputOptions = await PluginDriver.callOptionsHook(option, true);
|
|
2835
|
+
return createBundlerOptions(inputOptions, output, true);
|
|
2835
2836
|
})).flat());
|
|
2836
2837
|
const notifyOptions = getValidNotifyOption(bundlerOptions);
|
|
2837
2838
|
const bindingWatcher = new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
|
|
@@ -2859,7 +2860,7 @@ const watch = (input) => {
|
|
|
2859
2860
|
|
|
2860
2861
|
//#endregion
|
|
2861
2862
|
//#region package.json
|
|
2862
|
-
var version = "1.0.0-beta.7-commit.
|
|
2863
|
+
var version = "1.0.0-beta.7-commit.7ddcaea";
|
|
2863
2864
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2864
2865
|
|
|
2865
2866
|
//#endregion
|
|
@@ -84,7 +84,7 @@ function normalizeHook(hook) {
|
|
|
84
84
|
|
|
85
85
|
//#endregion
|
|
86
86
|
//#region src/log/logger.ts
|
|
87
|
-
function getLogger(plugins, onLog, logLevel) {
|
|
87
|
+
function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
88
88
|
const minimalPriority = logLevelPriority[logLevel];
|
|
89
89
|
const logger = (level, log, skipped = new Set()) => {
|
|
90
90
|
const logPriority = logLevelPriority[level];
|
|
@@ -105,7 +105,7 @@ function getLogger(plugins, onLog, logLevel) {
|
|
|
105
105
|
meta: {
|
|
106
106
|
rollupVersion: "4.23.0",
|
|
107
107
|
rolldownVersion: VERSION,
|
|
108
|
-
watchMode
|
|
108
|
+
watchMode
|
|
109
109
|
},
|
|
110
110
|
warn: getLogHandler$1(LOG_LEVEL_WARN),
|
|
111
111
|
pluginName: plugin.name || "unknown"
|
|
@@ -334,10 +334,10 @@ const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
|
|
|
334
334
|
//#endregion
|
|
335
335
|
//#region src/plugin/plugin-driver.ts
|
|
336
336
|
var PluginDriver = class {
|
|
337
|
-
static async callOptionsHook(inputOptions) {
|
|
337
|
+
static async callOptionsHook(inputOptions, watchMode = false) {
|
|
338
338
|
const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
|
|
339
339
|
const plugins = getSortedPlugins("options", getObjectPlugins(await normalizePluginOption(inputOptions.plugins)));
|
|
340
|
-
const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), logLevel);
|
|
340
|
+
const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), logLevel, watchMode);
|
|
341
341
|
for (const plugin of plugins) {
|
|
342
342
|
const name = plugin.name || "unknown";
|
|
343
343
|
const options = plugin.options;
|
|
@@ -350,7 +350,7 @@ var PluginDriver = class {
|
|
|
350
350
|
meta: {
|
|
351
351
|
rollupVersion: "4.23.0",
|
|
352
352
|
rolldownVersion: VERSION,
|
|
353
|
-
watchMode
|
|
353
|
+
watchMode
|
|
354
354
|
},
|
|
355
355
|
warn: getLogHandler(LOG_LEVEL_WARN, "PLUGIN_WARNING", logger, name, logLevel),
|
|
356
356
|
pluginName: name
|
|
@@ -1102,7 +1102,7 @@ var MinimalPluginContextImpl = class {
|
|
|
1102
1102
|
warn;
|
|
1103
1103
|
debug;
|
|
1104
1104
|
meta;
|
|
1105
|
-
constructor(onLog, logLevel, pluginName) {
|
|
1105
|
+
constructor(onLog, logLevel, pluginName, watchMode) {
|
|
1106
1106
|
this.pluginName = pluginName;
|
|
1107
1107
|
this.debug = getLogHandler(LOG_LEVEL_DEBUG, "PLUGIN_LOG", onLog, pluginName, logLevel);
|
|
1108
1108
|
this.info = getLogHandler(LOG_LEVEL_INFO, "PLUGIN_LOG", onLog, pluginName, logLevel);
|
|
@@ -1110,7 +1110,7 @@ var MinimalPluginContextImpl = class {
|
|
|
1110
1110
|
this.meta = {
|
|
1111
1111
|
rollupVersion: "4.23.0",
|
|
1112
1112
|
rolldownVersion: VERSION,
|
|
1113
|
-
watchMode
|
|
1113
|
+
watchMode
|
|
1114
1114
|
};
|
|
1115
1115
|
}
|
|
1116
1116
|
error(e) {
|
|
@@ -1153,8 +1153,8 @@ function bindingResolvedExternal(external) {
|
|
|
1153
1153
|
//#region src/plugin/plugin-context.ts
|
|
1154
1154
|
var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
1155
1155
|
getModuleInfo;
|
|
1156
|
-
constructor(outputOptions, context, plugin, data, onLog, logLevel, currentLoadingModule) {
|
|
1157
|
-
super(onLog, logLevel, plugin.name);
|
|
1156
|
+
constructor(outputOptions, context, plugin, data, onLog, logLevel, watchMode, currentLoadingModule) {
|
|
1157
|
+
super(onLog, logLevel, plugin.name, watchMode);
|
|
1158
1158
|
this.outputOptions = outputOptions;
|
|
1159
1159
|
this.context = context;
|
|
1160
1160
|
this.data = data;
|
|
@@ -1243,8 +1243,8 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
1243
1243
|
//#endregion
|
|
1244
1244
|
//#region src/plugin/transform-plugin-context.ts
|
|
1245
1245
|
var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
1246
|
-
constructor(outputOptions, context, plugin, data, inner, moduleId, moduleSource, onLog, LogLevelOption) {
|
|
1247
|
-
super(outputOptions, context, plugin, data, onLog, LogLevelOption, moduleId);
|
|
1246
|
+
constructor(outputOptions, context, plugin, data, inner, moduleId, moduleSource, onLog, LogLevelOption, watchMode) {
|
|
1247
|
+
super(outputOptions, context, plugin, data, onLog, LogLevelOption, watchMode, moduleId);
|
|
1248
1248
|
this.inner = inner;
|
|
1249
1249
|
this.moduleId = moduleId;
|
|
1250
1250
|
this.moduleSource = moduleSource;
|
|
@@ -1349,7 +1349,7 @@ function bindingifyBuildStart(args) {
|
|
|
1349
1349
|
const { handler, meta } = normalizeHook(hook);
|
|
1350
1350
|
return {
|
|
1351
1351
|
plugin: async (ctx, opts) => {
|
|
1352
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1352
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1353
1353
|
},
|
|
1354
1354
|
meta: bindingifyPluginHookMeta(meta)
|
|
1355
1355
|
};
|
|
@@ -1360,7 +1360,7 @@ function bindingifyBuildEnd(args) {
|
|
|
1360
1360
|
const { handler, meta } = normalizeHook(hook);
|
|
1361
1361
|
return {
|
|
1362
1362
|
plugin: async (ctx, err) => {
|
|
1363
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), err ? normalizeErrors(err) : void 0);
|
|
1363
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), err ? normalizeErrors(err) : void 0);
|
|
1364
1364
|
},
|
|
1365
1365
|
meta: bindingifyPluginHookMeta(meta)
|
|
1366
1366
|
};
|
|
@@ -1377,7 +1377,7 @@ function bindingifyResolveId(args) {
|
|
|
1377
1377
|
custom: contextResolveOptions?.custom,
|
|
1378
1378
|
[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]: contextResolveOptions?.[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]
|
|
1379
1379
|
};
|
|
1380
|
-
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), specifier, importer ?? void 0, newExtraOptions);
|
|
1380
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), specifier, importer ?? void 0, newExtraOptions);
|
|
1381
1381
|
if (ret == null) return;
|
|
1382
1382
|
if (ret === false) return {
|
|
1383
1383
|
id: specifier,
|
|
@@ -1410,7 +1410,7 @@ function bindingifyResolveDynamicImport(args) {
|
|
|
1410
1410
|
const { handler, meta } = normalizeHook(hook);
|
|
1411
1411
|
return {
|
|
1412
1412
|
plugin: async (ctx, specifier, importer) => {
|
|
1413
|
-
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), specifier, importer ?? void 0);
|
|
1413
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), specifier, importer ?? void 0);
|
|
1414
1414
|
if (ret == null) return;
|
|
1415
1415
|
if (ret === false) return {
|
|
1416
1416
|
id: specifier,
|
|
@@ -1438,7 +1438,7 @@ function bindingifyTransform(args) {
|
|
|
1438
1438
|
const { handler, meta, options } = normalizeHook(hook);
|
|
1439
1439
|
return {
|
|
1440
1440
|
plugin: async (ctx, code, id, meta$1) => {
|
|
1441
|
-
const ret = await handler.call(new TransformPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel), code, id, meta$1);
|
|
1441
|
+
const ret = await handler.call(new TransformPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel, args.watchMode), code, id, meta$1);
|
|
1442
1442
|
if (ret == null) return void 0;
|
|
1443
1443
|
if (typeof ret === "string") return { code: ret };
|
|
1444
1444
|
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
@@ -1463,7 +1463,7 @@ function bindingifyLoad(args) {
|
|
|
1463
1463
|
const { handler, meta, options } = normalizeHook(hook);
|
|
1464
1464
|
return {
|
|
1465
1465
|
plugin: async (ctx, id) => {
|
|
1466
|
-
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, id), id);
|
|
1466
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode, id), id);
|
|
1467
1467
|
if (ret == null) return;
|
|
1468
1468
|
if (typeof ret === "string") return { code: ret };
|
|
1469
1469
|
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
@@ -1499,7 +1499,7 @@ function bindingifyModuleParsed(args) {
|
|
|
1499
1499
|
const { handler, meta } = normalizeHook(hook);
|
|
1500
1500
|
return {
|
|
1501
1501
|
plugin: async (ctx, moduleInfo) => {
|
|
1502
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
|
|
1502
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
|
|
1503
1503
|
},
|
|
1504
1504
|
meta: bindingifyPluginHookMeta(meta)
|
|
1505
1505
|
};
|
|
@@ -1696,7 +1696,7 @@ function bindingifyRenderStart(args) {
|
|
|
1696
1696
|
const { handler, meta } = normalizeHook(hook);
|
|
1697
1697
|
return {
|
|
1698
1698
|
plugin: async (ctx, opts) => {
|
|
1699
|
-
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1699
|
+
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1700
1700
|
},
|
|
1701
1701
|
meta: bindingifyPluginHookMeta(meta)
|
|
1702
1702
|
};
|
|
@@ -1707,7 +1707,7 @@ function bindingifyRenderChunk(args) {
|
|
|
1707
1707
|
const { handler, meta } = normalizeHook(hook);
|
|
1708
1708
|
return {
|
|
1709
1709
|
plugin: async (ctx, code, chunk, opts, chunks) => {
|
|
1710
|
-
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), { chunks: Object.fromEntries(Object.entries(chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
|
|
1710
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), { chunks: Object.fromEntries(Object.entries(chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
|
|
1711
1711
|
if (ret == null) return;
|
|
1712
1712
|
if (typeof ret === "string") return { code: ret };
|
|
1713
1713
|
if (!ret.map) return { code: ret.code };
|
|
@@ -1725,7 +1725,7 @@ function bindingifyAugmentChunkHash(args) {
|
|
|
1725
1725
|
const { handler, meta } = normalizeHook(hook);
|
|
1726
1726
|
return {
|
|
1727
1727
|
plugin: async (ctx, chunk) => {
|
|
1728
|
-
return await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1728
|
+
return await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1729
1729
|
},
|
|
1730
1730
|
meta: bindingifyPluginHookMeta(meta)
|
|
1731
1731
|
};
|
|
@@ -1736,7 +1736,7 @@ function bindingifyRenderError(args) {
|
|
|
1736
1736
|
const { handler, meta } = normalizeHook(hook);
|
|
1737
1737
|
return {
|
|
1738
1738
|
plugin: async (ctx, err) => {
|
|
1739
|
-
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), normalizeErrors(err));
|
|
1739
|
+
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), normalizeErrors(err));
|
|
1740
1740
|
},
|
|
1741
1741
|
meta: bindingifyPluginHookMeta(meta)
|
|
1742
1742
|
};
|
|
@@ -1752,7 +1752,7 @@ function bindingifyGenerateBundle(args) {
|
|
|
1752
1752
|
deleted: new Set()
|
|
1753
1753
|
};
|
|
1754
1754
|
const output = transformToOutputBundle(bundle, changed);
|
|
1755
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output, isWrite);
|
|
1755
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output, isWrite);
|
|
1756
1756
|
return collectChangedBundle(changed, output);
|
|
1757
1757
|
},
|
|
1758
1758
|
meta: bindingifyPluginHookMeta(meta)
|
|
@@ -1769,7 +1769,7 @@ function bindingifyWriteBundle(args) {
|
|
|
1769
1769
|
deleted: new Set()
|
|
1770
1770
|
};
|
|
1771
1771
|
const output = transformToOutputBundle(bundle, changed);
|
|
1772
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output);
|
|
1772
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output);
|
|
1773
1773
|
return collectChangedBundle(changed, output);
|
|
1774
1774
|
},
|
|
1775
1775
|
meta: bindingifyPluginHookMeta(meta)
|
|
@@ -1781,7 +1781,7 @@ function bindingifyCloseBundle(args) {
|
|
|
1781
1781
|
const { handler, meta } = normalizeHook(hook);
|
|
1782
1782
|
return {
|
|
1783
1783
|
plugin: async (ctx) => {
|
|
1784
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel));
|
|
1784
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
|
|
1785
1785
|
},
|
|
1786
1786
|
meta: bindingifyPluginHookMeta(meta)
|
|
1787
1787
|
};
|
|
@@ -1793,7 +1793,7 @@ function bindingifyBanner(args) {
|
|
|
1793
1793
|
return {
|
|
1794
1794
|
plugin: async (ctx, chunk) => {
|
|
1795
1795
|
if (typeof handler === "string") return handler;
|
|
1796
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1796
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1797
1797
|
},
|
|
1798
1798
|
meta: bindingifyPluginHookMeta(meta)
|
|
1799
1799
|
};
|
|
@@ -1805,7 +1805,7 @@ function bindingifyFooter(args) {
|
|
|
1805
1805
|
return {
|
|
1806
1806
|
plugin: async (ctx, chunk) => {
|
|
1807
1807
|
if (typeof handler === "string") return handler;
|
|
1808
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1808
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1809
1809
|
},
|
|
1810
1810
|
meta: bindingifyPluginHookMeta(meta)
|
|
1811
1811
|
};
|
|
@@ -1817,7 +1817,7 @@ function bindingifyIntro(args) {
|
|
|
1817
1817
|
return {
|
|
1818
1818
|
plugin: async (ctx, chunk) => {
|
|
1819
1819
|
if (typeof handler === "string") return handler;
|
|
1820
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1820
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1821
1821
|
},
|
|
1822
1822
|
meta: bindingifyPluginHookMeta(meta)
|
|
1823
1823
|
};
|
|
@@ -1829,7 +1829,7 @@ function bindingifyOutro(args) {
|
|
|
1829
1829
|
return {
|
|
1830
1830
|
plugin: async (ctx, chunk) => {
|
|
1831
1831
|
if (typeof handler === "string") return handler;
|
|
1832
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1832
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1833
1833
|
},
|
|
1834
1834
|
meta: bindingifyPluginHookMeta(meta)
|
|
1835
1835
|
};
|
|
@@ -1843,7 +1843,7 @@ function bindingifyWatchChange(args) {
|
|
|
1843
1843
|
const { handler, meta } = normalizeHook(hook);
|
|
1844
1844
|
return {
|
|
1845
1845
|
plugin: async (ctx, id, event) => {
|
|
1846
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), id, { event });
|
|
1846
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), id, { event });
|
|
1847
1847
|
},
|
|
1848
1848
|
meta: bindingifyPluginHookMeta(meta)
|
|
1849
1849
|
};
|
|
@@ -1854,7 +1854,7 @@ function bindingifyCloseWatcher(args) {
|
|
|
1854
1854
|
const { handler, meta } = normalizeHook(hook);
|
|
1855
1855
|
return {
|
|
1856
1856
|
plugin: async (ctx) => {
|
|
1857
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel));
|
|
1857
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
|
|
1858
1858
|
},
|
|
1859
1859
|
meta: bindingifyPluginHookMeta(meta)
|
|
1860
1860
|
};
|
|
@@ -1862,7 +1862,7 @@ function bindingifyCloseWatcher(args) {
|
|
|
1862
1862
|
|
|
1863
1863
|
//#endregion
|
|
1864
1864
|
//#region src/plugin/bindingify-plugin.ts
|
|
1865
|
-
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel) {
|
|
1865
|
+
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
1866
1866
|
const args = {
|
|
1867
1867
|
plugin,
|
|
1868
1868
|
options,
|
|
@@ -1870,6 +1870,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1870
1870
|
pluginContextData,
|
|
1871
1871
|
onLog,
|
|
1872
1872
|
logLevel,
|
|
1873
|
+
watchMode,
|
|
1873
1874
|
normalizedOutputPlugins
|
|
1874
1875
|
};
|
|
1875
1876
|
const { plugin: buildStart, meta: buildStartMeta } = bindingifyBuildStart(args);
|
|
@@ -2060,12 +2061,12 @@ function normalizedStringOrRegex(pattern) {
|
|
|
2060
2061
|
|
|
2061
2062
|
//#endregion
|
|
2062
2063
|
//#region src/utils/bindingify-input-options.ts
|
|
2063
|
-
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel) {
|
|
2064
|
+
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
2064
2065
|
const pluginContextData = new PluginContextData();
|
|
2065
2066
|
const plugins = rawPlugins.map((plugin) => {
|
|
2066
2067
|
if ("_parallel" in plugin) return void 0;
|
|
2067
2068
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
2068
|
-
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel);
|
|
2069
|
+
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
2069
2070
|
});
|
|
2070
2071
|
return {
|
|
2071
2072
|
input: bindingifyInput(inputOptions.input),
|
|
@@ -2635,11 +2636,11 @@ async function initializeWorker(registryId, pluginInfos, threadNumber) {
|
|
|
2635
2636
|
|
|
2636
2637
|
//#endregion
|
|
2637
2638
|
//#region src/utils/create-bundler-option.ts
|
|
2638
|
-
async function createBundlerOptions(inputOptions, outputOptions, isClose) {
|
|
2639
|
+
async function createBundlerOptions(inputOptions, outputOptions, watchMode, isClose) {
|
|
2639
2640
|
const inputPlugins = await normalizePluginOption(inputOptions.plugins);
|
|
2640
2641
|
const outputPlugins = await normalizePluginOption(outputOptions.plugins);
|
|
2641
2642
|
const logLevel = inputOptions.logLevel || LOG_LEVEL_INFO;
|
|
2642
|
-
const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel);
|
|
2643
|
+
const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel, watchMode);
|
|
2643
2644
|
if (!isClose) outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions);
|
|
2644
2645
|
if (outputOptions.minify === true) onLog(LOG_LEVEL_WARN, require_parse_ast_index.logMinifyWarning());
|
|
2645
2646
|
const normalizedOutputPlugins = await normalizePluginOption(outputOptions.plugins);
|
|
@@ -2647,7 +2648,7 @@ async function createBundlerOptions(inputOptions, outputOptions, isClose) {
|
|
|
2647
2648
|
if (inputOptions.experimental?.enableComposingJsPlugins ?? false) plugins = composeJsPlugins(plugins);
|
|
2648
2649
|
const parallelPluginInitResult = await initializeParallelPlugins(plugins);
|
|
2649
2650
|
try {
|
|
2650
|
-
const bindingInputOptions = bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel);
|
|
2651
|
+
const bindingInputOptions = bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
2651
2652
|
const bindingOutputOptions = bindingifyOutputOptions(outputOptions);
|
|
2652
2653
|
return {
|
|
2653
2654
|
bundlerOptions: {
|
|
@@ -2669,7 +2670,7 @@ async function createBundlerOptions(inputOptions, outputOptions, isClose) {
|
|
|
2669
2670
|
//#region src/utils/create-bundler.ts
|
|
2670
2671
|
let asyncRuntimeShutdown = false;
|
|
2671
2672
|
async function createBundler(inputOptions, outputOptions, isClose) {
|
|
2672
|
-
const option = await createBundlerOptions(inputOptions, outputOptions, isClose);
|
|
2673
|
+
const option = await createBundlerOptions(inputOptions, outputOptions, false, isClose);
|
|
2673
2674
|
if (asyncRuntimeShutdown) (0, require_parse_ast_index.import_binding.startAsyncRuntime)();
|
|
2674
2675
|
try {
|
|
2675
2676
|
return {
|
|
@@ -2832,8 +2833,8 @@ var Watcher = class {
|
|
|
2832
2833
|
async function createWatcher(emitter, input) {
|
|
2833
2834
|
const options = arraify(input);
|
|
2834
2835
|
const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
|
|
2835
|
-
const inputOptions = await PluginDriver.callOptionsHook(option);
|
|
2836
|
-
return createBundlerOptions(inputOptions, output);
|
|
2836
|
+
const inputOptions = await PluginDriver.callOptionsHook(option, true);
|
|
2837
|
+
return createBundlerOptions(inputOptions, output, true);
|
|
2837
2838
|
})).flat());
|
|
2838
2839
|
const notifyOptions = getValidNotifyOption(bundlerOptions);
|
|
2839
2840
|
const bindingWatcher = new require_parse_ast_index.import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
|
|
@@ -2861,7 +2862,7 @@ const watch = (input) => {
|
|
|
2861
2862
|
|
|
2862
2863
|
//#endregion
|
|
2863
2864
|
//#region package.json
|
|
2864
|
-
var version = "1.0.0-beta.7-commit.
|
|
2865
|
+
var version = "1.0.0-beta.7-commit.7ddcaea";
|
|
2865
2866
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2866
2867
|
|
|
2867
2868
|
//#endregion
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RolldownOutput, OutputAsset, OutputChunk, RenderedChunk, SourceMap } from './types/rolldown-output';
|
|
1
|
+
import { RolldownOutput, OutputAsset, OutputChunk, RenderedModule, RenderedChunk, SourceMap } from './types/rolldown-output';
|
|
2
2
|
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './options/input-options';
|
|
3
3
|
import type { ModuleFormat, OutputOptions, PreRenderedAsset } from './options/output-options';
|
|
4
4
|
import type { RolldownOptions } from './types/rolldown-options';
|
|
@@ -26,5 +26,5 @@ import { RolldownWatcher } from './api/watch/watch-emitter';
|
|
|
26
26
|
import { build, type BuildOptions } from './api/build';
|
|
27
27
|
export { defineConfig, rolldown, watch, build };
|
|
28
28
|
export declare const VERSION: string;
|
|
29
|
-
export type { OutputAsset, OutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, RolldownPluginOption, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, HookFilterExtension, HookFilter, StringFilter, ModuleTypeFilter, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, PreRenderedAsset, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, PluginContextMeta, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, RolldownWatcher, BuildOptions, RenderedChunk, LogOrStringHandler, GetModuleInfo, };
|
|
29
|
+
export type { OutputAsset, OutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, RolldownPluginOption, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, HookFilterExtension, HookFilter, StringFilter, ModuleTypeFilter, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, PreRenderedAsset, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, PluginContextMeta, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, RolldownWatcher, BuildOptions, RenderedModule, RenderedChunk, LogOrStringHandler, GetModuleInfo, };
|
|
30
30
|
export type { RollupError, RollupLog, LoggingFunction, LogLevel, WarningHandlerWithDefault, } from './types/misc';
|
|
@@ -2,5 +2,5 @@ import type { LogHandler } from '../types/misc';
|
|
|
2
2
|
import type { Plugin } from '../plugin';
|
|
3
3
|
import { type LogLevelOption } from './logging';
|
|
4
4
|
import type { InputOptions } from '../options/input-options';
|
|
5
|
-
export declare function getLogger(plugins: Plugin[], onLog: LogHandler, logLevel: LogLevelOption): LogHandler;
|
|
5
|
+
export declare function getLogger(plugins: Plugin[], onLog: LogHandler, logLevel: LogLevelOption, watchMode: boolean): LogHandler;
|
|
6
6
|
export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => LogHandler;
|
|
@@ -11,6 +11,7 @@ export interface BindingifyPluginArgs {
|
|
|
11
11
|
pluginContextData: PluginContextData;
|
|
12
12
|
onLog: LogHandler;
|
|
13
13
|
logLevel: LogLevelOption;
|
|
14
|
+
watchMode: boolean;
|
|
14
15
|
normalizedOutputPlugins: RolldownPlugin[];
|
|
15
16
|
}
|
|
16
|
-
export declare function bindingifyPlugin(plugin: Plugin, options: InputOptions, outputOptions: OutputOptions, pluginContextData: PluginContextData, normalizedOutputPlugins: RolldownPlugin[], onLog: LogHandler, logLevel: LogLevelOption): BindingPluginOptions;
|
|
17
|
+
export declare function bindingifyPlugin(plugin: Plugin, options: InputOptions, outputOptions: OutputOptions, pluginContextData: PluginContextData, normalizedOutputPlugins: RolldownPlugin[], onLog: LogHandler, logLevel: LogLevelOption, watchMode: boolean): BindingPluginOptions;
|
|
@@ -18,6 +18,6 @@ export declare class MinimalPluginContextImpl {
|
|
|
18
18
|
warn: LoggingFunction;
|
|
19
19
|
debug: LoggingFunction;
|
|
20
20
|
meta: PluginContextMeta;
|
|
21
|
-
constructor(onLog: LogHandler, logLevel: LogLevelOption, pluginName: string);
|
|
21
|
+
constructor(onLog: LogHandler, logLevel: LogLevelOption, pluginName: string, watchMode: boolean);
|
|
22
22
|
error(e: RollupError | string): never;
|
|
23
23
|
}
|
|
@@ -52,7 +52,7 @@ export declare class PluginContextImpl extends MinimalPluginContextImpl {
|
|
|
52
52
|
private onLog;
|
|
53
53
|
private currentLoadingModule?;
|
|
54
54
|
getModuleInfo: GetModuleInfo;
|
|
55
|
-
constructor(outputOptions: OutputOptions, context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, currentLoadingModule?: string | undefined);
|
|
55
|
+
constructor(outputOptions: OutputOptions, context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, watchMode: boolean, currentLoadingModule?: string | undefined);
|
|
56
56
|
load(options: {
|
|
57
57
|
id: string;
|
|
58
58
|
resolveDependencies?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from './';
|
|
2
2
|
import { InputOptions, OutputOptions, RolldownPlugin } from '..';
|
|
3
3
|
export declare class PluginDriver {
|
|
4
|
-
static callOptionsHook(inputOptions: InputOptions): Promise<InputOptions>;
|
|
4
|
+
static callOptionsHook(inputOptions: InputOptions, watchMode?: boolean): Promise<InputOptions>;
|
|
5
5
|
static callOutputOptionsHook(rawPlugins: RolldownPlugin[], outputOptions: OutputOptions): OutputOptions;
|
|
6
6
|
}
|
|
7
7
|
export declare function getObjectPlugins(plugins: RolldownPlugin[]): Plugin[];
|
|
@@ -19,7 +19,7 @@ export declare class TransformPluginContextImpl extends PluginContextImpl {
|
|
|
19
19
|
private inner;
|
|
20
20
|
private moduleId;
|
|
21
21
|
private moduleSource;
|
|
22
|
-
constructor(outputOptions: OutputOptions, context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption);
|
|
22
|
+
constructor(outputOptions: OutputOptions, context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption, watchMode: boolean);
|
|
23
23
|
error(e: RollupError | string, pos?: number | {
|
|
24
24
|
column: number;
|
|
25
25
|
line: number;
|
|
@@ -4,4 +4,4 @@ import type { OutputOptions } from '../options/output-options';
|
|
|
4
4
|
import type { BindingInputOptions } from '../binding';
|
|
5
5
|
import { LogHandler } from '../types/misc';
|
|
6
6
|
import { LogLevelOption } from '../log/logging';
|
|
7
|
-
export declare function bindingifyInputOptions(rawPlugins: RolldownPlugin[], inputOptions: InputOptions, outputOptions: OutputOptions, normalizedOutputPlugins: RolldownPlugin[], onLog: LogHandler, logLevel: LogLevelOption): BindingInputOptions;
|
|
7
|
+
export declare function bindingifyInputOptions(rawPlugins: RolldownPlugin[], inputOptions: InputOptions, outputOptions: OutputOptions, normalizedOutputPlugins: RolldownPlugin[], onLog: LogHandler, logLevel: LogLevelOption, watchMode: boolean): BindingInputOptions;
|
|
@@ -2,7 +2,7 @@ import { BindingBundlerOptions } from '../binding';
|
|
|
2
2
|
import { LogHandler } from '../types/misc';
|
|
3
3
|
import type { InputOptions } from '../options/input-options';
|
|
4
4
|
import type { OutputOptions } from '../options/output-options';
|
|
5
|
-
export declare function createBundlerOptions(inputOptions: InputOptions, outputOptions: OutputOptions, isClose?: boolean): Promise<BundlerOptionWithStopWorker>;
|
|
5
|
+
export declare function createBundlerOptions(inputOptions: InputOptions, outputOptions: OutputOptions, watchMode: boolean, isClose?: boolean): Promise<BundlerOptionWithStopWorker>;
|
|
6
6
|
export interface BundlerOptionWithStopWorker {
|
|
7
7
|
bundlerOptions: BindingBundlerOptions;
|
|
8
8
|
inputOptions: InputOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "1.0.0-beta.7-commit.
|
|
3
|
+
"version": "1.0.0-beta.7-commit.7ddcaea",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -123,21 +123,21 @@
|
|
|
123
123
|
"unbuild": "^3.0.0",
|
|
124
124
|
"why-is-node-running": "^3.0.0",
|
|
125
125
|
"@rolldown/testing": "0.0.1",
|
|
126
|
-
"rolldown": "1.0.0-beta.7-commit.
|
|
126
|
+
"rolldown": "1.0.0-beta.7-commit.7ddcaea"
|
|
127
127
|
},
|
|
128
128
|
"optionalDependencies": {
|
|
129
|
-
"@rolldown/binding-darwin-arm64": "1.0.0-beta.7-commit.
|
|
130
|
-
"@rolldown/binding-
|
|
131
|
-
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.7-commit.
|
|
132
|
-
"@rolldown/binding-
|
|
133
|
-
"@rolldown/binding-linux-arm64-
|
|
134
|
-
"@rolldown/binding-linux-
|
|
135
|
-
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.7-commit.
|
|
136
|
-
"@rolldown/binding-
|
|
137
|
-
"@rolldown/binding-
|
|
138
|
-
"@rolldown/binding-
|
|
139
|
-
"@rolldown/binding-win32-
|
|
140
|
-
"@rolldown/binding-win32-
|
|
129
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.7-commit.7ddcaea",
|
|
130
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.7-commit.7ddcaea",
|
|
131
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.7-commit.7ddcaea",
|
|
132
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.7-commit.7ddcaea",
|
|
133
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.7-commit.7ddcaea",
|
|
134
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.7-commit.7ddcaea",
|
|
135
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.7-commit.7ddcaea",
|
|
136
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.7-commit.7ddcaea",
|
|
137
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.7-commit.7ddcaea",
|
|
138
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.7-commit.7ddcaea",
|
|
139
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.7-commit.7ddcaea",
|
|
140
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.7-commit.7ddcaea"
|
|
141
141
|
},
|
|
142
142
|
"scripts": {
|
|
143
143
|
"# Scrips for binding #": "_",
|