rolldown 1.0.0-beta.3-commit.306867e → 1.0.0-beta.3-commit.f65bde3
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 +2 -2
- package/dist/cjs/experimental-index.cjs +2 -2
- package/dist/cjs/index.cjs +2 -2
- package/dist/cjs/parallel-plugin-worker.cjs +2 -2
- package/dist/cjs/parse-ast-index.cjs +1 -1
- package/dist/esm/cli.mjs +2 -2
- package/dist/esm/experimental-index.mjs +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/parallel-plugin-worker.mjs +2 -2
- package/dist/esm/parse-ast-index.mjs +1 -1
- package/dist/shared/{binding-_xN4hdfO.mjs → binding-CFTx0Fs7.mjs} +3 -3
- package/dist/shared/{binding-B9_Bsc0_.cjs → binding-DTKqYZn-.cjs} +3 -3
- package/dist/shared/{src-BGJCTYiA.mjs → src-46qAwcxx.mjs} +54 -17
- package/dist/shared/{src-BL6ftzBh.cjs → src-CoQJ2u3O.cjs} +54 -17
- package/dist/types/binding.d.ts +7 -0
- package/dist/types/index.d.ts +4 -3
- package/dist/types/log/logging.d.ts +1 -0
- package/dist/types/options/input-options.d.ts +2 -2
- package/dist/types/plugin/index.d.ts +1 -0
- package/dist/types/plugin/plugin-context-data.d.ts +2 -1
- package/package.json +19 -19
- package/dist/types/api/build.js +0 -22
- package/dist/types/api/experimental.js +0 -13
- package/dist/types/api/rolldown/index.js +0 -7
- package/dist/types/api/rolldown/rolldown-build.js +0 -43
- package/dist/types/api/watch/index.js +0 -8
- package/dist/types/api/watch/watch-emitter.js +0 -69
- package/dist/types/api/watch/watcher.js +0 -66
- package/dist/types/builtin-plugin/alias-plugin.js +0 -4
- package/dist/types/builtin-plugin/constructors.js +0 -68
- package/dist/types/builtin-plugin/replace-plugin.js +0 -29
- package/dist/types/builtin-plugin/transform-plugin.js +0 -16
- package/dist/types/builtin-plugin/utils.js +0 -19
- package/dist/types/cli/arguments/alias.js +0 -63
- package/dist/types/cli/arguments/index.js +0 -127
- package/dist/types/cli/arguments/normalize.js +0 -48
- package/dist/types/cli/arguments/utils.js +0 -67
- package/dist/types/cli/colors.js +0 -17
- package/dist/types/cli/commands/bundle.js +0 -203
- package/dist/types/cli/commands/help.js +0 -88
- package/dist/types/cli/index.js +0 -27
- package/dist/types/cli/load-config.js +0 -95
- package/dist/types/cli/logger.js +0 -35
- package/dist/types/constants/plugin-context.js +0 -7
- package/dist/types/constants/plugin.js +0 -69
- package/dist/types/experimental-index.js +0 -9
- package/dist/types/index.js +0 -7
- package/dist/types/log/logHandler.js +0 -25
- package/dist/types/log/logger.js +0 -107
- package/dist/types/log/logging.js +0 -11
- package/dist/types/log/logs.js +0 -86
- package/dist/types/options/input-options.js +0 -1
- package/dist/types/options/normalized-input-options.js +0 -21
- package/dist/types/options/normalized-output-options.js +0 -99
- package/dist/types/options/output-options.js +0 -1
- package/dist/types/options/watch-options.js +0 -1
- package/dist/types/parallel-plugin-worker.js +0 -31
- package/dist/types/parallel-plugin.js +0 -1
- package/dist/types/parse-ast-index.js +0 -73
- package/dist/types/plugin/bindingify-build-hooks.js +0 -213
- package/dist/types/plugin/bindingify-hook-filter.js +0 -39
- package/dist/types/plugin/bindingify-output-hooks.js +0 -189
- package/dist/types/plugin/bindingify-plugin-hook-meta.js +0 -19
- package/dist/types/plugin/bindingify-plugin.js +0 -124
- package/dist/types/plugin/bindingify-watch-hooks.js +0 -29
- package/dist/types/plugin/hook-filter.js +0 -1
- package/dist/types/plugin/index.js +0 -1
- package/dist/types/plugin/minimal-plugin-context.js +0 -25
- package/dist/types/plugin/parallel-plugin-implementation.js +0 -3
- package/dist/types/plugin/parallel-plugin.js +0 -6
- package/dist/types/plugin/plugin-context-data.js +0 -55
- package/dist/types/plugin/plugin-context.js +0 -124
- package/dist/types/plugin/plugin-driver.js +0 -88
- package/dist/types/plugin/transform-plugin-context.js +0 -37
- package/dist/types/types/assert.js +0 -1
- package/dist/types/types/config-export.js +0 -1
- package/dist/types/types/misc.js +0 -1
- package/dist/types/types/module-info.js +0 -1
- package/dist/types/types/module-side-effects.js +0 -1
- package/dist/types/types/output-bundle.js +0 -1
- package/dist/types/types/rolldown-options.js +0 -1
- package/dist/types/types/rolldown-output.js +0 -1
- package/dist/types/types/schema.js +0 -1
- package/dist/types/types/sourcemap.js +0 -16
- package/dist/types/types/utils.js +0 -1
- package/dist/types/utils/asset-source.js +0 -8
- package/dist/types/utils/async-flatten.js +0 -7
- package/dist/types/utils/bindingify-input-options.js +0 -226
- package/dist/types/utils/bindingify-output-options.js +0 -107
- package/dist/types/utils/code-frame.js +0 -46
- package/dist/types/utils/compose-js-plugins.js +0 -400
- package/dist/types/utils/create-bundler-option.js +0 -53
- package/dist/types/utils/create-bundler.js +0 -15
- package/dist/types/utils/define-config.js +0 -3
- package/dist/types/utils/error.js +0 -65
- package/dist/types/utils/initialize-parallel-plugins.js +0 -54
- package/dist/types/utils/misc.js +0 -22
- package/dist/types/utils/normalize-hook.js +0 -21
- package/dist/types/utils/normalize-plugin-option.js +0 -35
- package/dist/types/utils/normalize-string-or-regex.js +0 -14
- package/dist/types/utils/plugin/index.js +0 -7
- package/dist/types/utils/transform-module-info.js +0 -19
- package/dist/types/utils/transform-rendered-chunk.js +0 -43
- package/dist/types/utils/transform-rendered-module.js +0 -10
- package/dist/types/utils/transform-side-effects.js +0 -16
- package/dist/types/utils/transform-sourcemap.js +0 -29
- package/dist/types/utils/transform-to-rollup-output.js +0 -165
- package/dist/types/utils/validator.js +0 -276
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
4
|
-
const require_binding = require('../shared/binding-
|
|
3
|
+
const require_src = require('../shared/src-CoQJ2u3O.cjs');
|
|
4
|
+
const require_binding = require('../shared/binding-DTKqYZn-.cjs');
|
|
5
5
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
6
6
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
7
7
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
4
|
-
const require_binding = require('../shared/binding-
|
|
3
|
+
const require_src = require('../shared/src-CoQJ2u3O.cjs');
|
|
4
|
+
const require_binding = require('../shared/binding-DTKqYZn-.cjs');
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
6
|
|
|
7
7
|
//#region src/plugin/parallel-plugin.ts
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_src = require('../shared/src-
|
|
2
|
-
require('../shared/binding-
|
|
1
|
+
const require_src = require('../shared/src-CoQJ2u3O.cjs');
|
|
2
|
+
require('../shared/binding-DTKqYZn-.cjs');
|
|
3
3
|
|
|
4
4
|
exports.VERSION = require_src.VERSION
|
|
5
5
|
exports.build = require_src.build
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
4
|
-
const require_binding = require('../shared/binding-
|
|
3
|
+
const require_src = require('../shared/src-CoQJ2u3O.cjs');
|
|
4
|
+
const require_binding = require('../shared/binding-DTKqYZn-.cjs');
|
|
5
5
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
6
6
|
|
|
7
7
|
//#region src/parallel-plugin-worker.ts
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { colors } from "../shared/binding-
|
|
2
|
-
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-
|
|
1
|
+
import { colors } from "../shared/binding-CFTx0Fs7.mjs";
|
|
2
|
+
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-46qAwcxx.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { import_binding } from "../shared/binding-
|
|
2
|
-
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-
|
|
1
|
+
import { import_binding } from "../shared/binding-CFTx0Fs7.mjs";
|
|
2
|
+
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-46qAwcxx.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
|
-
import "../shared/binding-
|
|
2
|
-
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-
|
|
1
|
+
import "../shared/binding-CFTx0Fs7.mjs";
|
|
2
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-46qAwcxx.mjs";
|
|
3
3
|
|
|
4
4
|
export { VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { import_binding } from "../shared/binding-
|
|
2
|
-
import { PluginContextData, bindingifyPlugin } from "../shared/src-
|
|
1
|
+
import { import_binding } from "../shared/binding-CFTx0Fs7.mjs";
|
|
2
|
+
import { PluginContextData, bindingifyPlugin } from "../shared/src-46qAwcxx.mjs";
|
|
3
3
|
import { parentPort, workerData } from "node:worker_threads";
|
|
4
4
|
|
|
5
5
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { error, getCodeFrame, import_binding, locate, logParseError } from "../shared/binding-
|
|
1
|
+
import { error, getCodeFrame, import_binding, locate, logParseError } from "../shared/binding-CFTx0Fs7.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/parse-ast-index.ts
|
|
4
4
|
function wrap(result, sourceText) {
|
|
@@ -279,8 +279,8 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
//#endregion
|
|
282
|
-
//#region src/binding.
|
|
283
|
-
var require_binding = __commonJS({ "src/binding.
|
|
282
|
+
//#region src/binding.js
|
|
283
|
+
var require_binding = __commonJS({ "src/binding.js"(exports, module) {
|
|
284
284
|
const { createRequire: createRequire$1 } = __require("node:module");
|
|
285
285
|
const { readFileSync } = __require("node:fs");
|
|
286
286
|
let nativeBinding = null;
|
|
@@ -604,7 +604,7 @@ var require_binding = __commonJS({ "src/binding.cjs"(exports, module) {
|
|
|
604
604
|
module.exports.Severity = nativeBinding.Severity;
|
|
605
605
|
module.exports.transform = nativeBinding.transform;
|
|
606
606
|
} });
|
|
607
|
-
var import_binding = __toESM(require_binding()
|
|
607
|
+
var import_binding = __toESM(require_binding());
|
|
608
608
|
|
|
609
609
|
//#endregion
|
|
610
610
|
export { augmentCodeLocation, colors, error, getCodeFrame, import_binding, locate, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logParseError, logPluginError };
|
|
@@ -252,8 +252,8 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
//#endregion
|
|
255
|
-
//#region src/binding.
|
|
256
|
-
var require_binding = require_chunk.__commonJS({ "src/binding.
|
|
255
|
+
//#region src/binding.js
|
|
256
|
+
var require_binding = require_chunk.__commonJS({ "src/binding.js"(exports, module) {
|
|
257
257
|
const { createRequire } = require("node:module");
|
|
258
258
|
require = createRequire(__filename);
|
|
259
259
|
const { readFileSync } = require("node:fs");
|
|
@@ -578,7 +578,7 @@ var require_binding = require_chunk.__commonJS({ "src/binding.cjs"(exports, modu
|
|
|
578
578
|
module.exports.Severity = nativeBinding.Severity;
|
|
579
579
|
module.exports.transform = nativeBinding.transform;
|
|
580
580
|
} });
|
|
581
|
-
var import_binding = require_chunk.__toESM(require_binding()
|
|
581
|
+
var import_binding = require_chunk.__toESM(require_binding());
|
|
582
582
|
|
|
583
583
|
//#endregion
|
|
584
584
|
Object.defineProperty(exports, 'augmentCodeLocation', {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { augmentCodeLocation, colors, error, import_binding, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError } from "./binding-
|
|
1
|
+
import { augmentCodeLocation, colors, error, import_binding, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logPluginError } from "./binding-CFTx0Fs7.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Buffer } from "node:buffer";
|
|
4
4
|
import { Worker } from "node:worker_threads";
|
|
@@ -757,7 +757,8 @@ var PluginContext = class extends MinimalPluginContext {
|
|
|
757
757
|
if (moduleInfo && moduleInfo.code !== null) return moduleInfo;
|
|
758
758
|
const rawOptions = {
|
|
759
759
|
meta: options.meta || {},
|
|
760
|
-
moduleSideEffects: options.moduleSideEffects || null
|
|
760
|
+
moduleSideEffects: options.moduleSideEffects || null,
|
|
761
|
+
invalidate: false
|
|
761
762
|
};
|
|
762
763
|
this.data.updateModuleOption(id, rawOptions);
|
|
763
764
|
async function createLoadModulePromise(context, data) {
|
|
@@ -976,14 +977,15 @@ function bindingifyResolveId(args) {
|
|
|
976
977
|
external: true
|
|
977
978
|
};
|
|
978
979
|
if (typeof ret === "string") return { id: ret };
|
|
979
|
-
args.pluginContextData.updateModuleOption(ret.id, {
|
|
980
|
+
let exist = args.pluginContextData.updateModuleOption(ret.id, {
|
|
980
981
|
meta: ret.meta || {},
|
|
981
|
-
moduleSideEffects: ret.moduleSideEffects
|
|
982
|
+
moduleSideEffects: ret.moduleSideEffects ?? null,
|
|
983
|
+
invalidate: false
|
|
982
984
|
});
|
|
983
985
|
return {
|
|
984
986
|
id: ret.id,
|
|
985
987
|
external: ret.external,
|
|
986
|
-
sideEffects: bindingifySideEffects(
|
|
988
|
+
sideEffects: bindingifySideEffects(exist.moduleSideEffects)
|
|
987
989
|
};
|
|
988
990
|
},
|
|
989
991
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -1010,7 +1012,8 @@ function bindingifyResolveDynamicImport(args) {
|
|
|
1010
1012
|
if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
|
|
1011
1013
|
args.pluginContextData.updateModuleOption(ret.id, {
|
|
1012
1014
|
meta: ret.meta || {},
|
|
1013
|
-
moduleSideEffects: ret.moduleSideEffects || null
|
|
1015
|
+
moduleSideEffects: ret.moduleSideEffects || null,
|
|
1016
|
+
invalidate: false
|
|
1014
1017
|
});
|
|
1015
1018
|
return result;
|
|
1016
1019
|
},
|
|
@@ -1026,14 +1029,15 @@ function bindingifyTransform(args) {
|
|
|
1026
1029
|
const ret = await handler.call(new TransformPluginContext(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel), code, id, meta$1);
|
|
1027
1030
|
if (ret == null) return void 0;
|
|
1028
1031
|
if (typeof ret === "string") return { code: ret };
|
|
1029
|
-
args.pluginContextData.updateModuleOption(id, {
|
|
1030
|
-
meta: ret.meta
|
|
1031
|
-
moduleSideEffects: ret.moduleSideEffects
|
|
1032
|
+
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
1033
|
+
meta: ret.meta ?? {},
|
|
1034
|
+
moduleSideEffects: ret.moduleSideEffects ?? null,
|
|
1035
|
+
invalidate: false
|
|
1032
1036
|
});
|
|
1033
1037
|
return {
|
|
1034
1038
|
code: ret.code,
|
|
1035
1039
|
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code, ret.map)),
|
|
1036
|
-
sideEffects: bindingifySideEffects(
|
|
1040
|
+
sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects),
|
|
1037
1041
|
moduleType: ret.moduleType
|
|
1038
1042
|
};
|
|
1039
1043
|
},
|
|
@@ -1050,16 +1054,17 @@ function bindingifyLoad(args) {
|
|
|
1050
1054
|
const ret = await handler.call(new PluginContext(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, id), id);
|
|
1051
1055
|
if (ret == null) return;
|
|
1052
1056
|
if (typeof ret === "string") return { code: ret };
|
|
1053
|
-
args.pluginContextData.updateModuleOption(id, {
|
|
1057
|
+
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
1054
1058
|
meta: ret.meta || {},
|
|
1055
|
-
moduleSideEffects: ret.moduleSideEffects
|
|
1059
|
+
moduleSideEffects: ret.moduleSideEffects ?? null,
|
|
1060
|
+
invalidate: false
|
|
1056
1061
|
});
|
|
1057
1062
|
let map = preProcessSourceMap(ret, id);
|
|
1058
1063
|
return {
|
|
1059
1064
|
code: ret.code,
|
|
1060
1065
|
map: bindingifySourcemap$1(map),
|
|
1061
1066
|
moduleType: ret.moduleType,
|
|
1062
|
-
sideEffects: bindingifySideEffects(
|
|
1067
|
+
sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects)
|
|
1063
1068
|
};
|
|
1064
1069
|
},
|
|
1065
1070
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -1486,7 +1491,12 @@ var PluginContextData = class {
|
|
|
1486
1491
|
if (existing) {
|
|
1487
1492
|
if (option.moduleSideEffects != null) existing.moduleSideEffects = option.moduleSideEffects;
|
|
1488
1493
|
if (option.meta != null) Object.assign(existing.meta, option.meta);
|
|
1489
|
-
|
|
1494
|
+
if (option.invalidate != null) existing.invalidate = option.invalidate;
|
|
1495
|
+
} else {
|
|
1496
|
+
this.moduleOptionMap.set(id, option);
|
|
1497
|
+
return option;
|
|
1498
|
+
}
|
|
1499
|
+
return existing;
|
|
1490
1500
|
}
|
|
1491
1501
|
getModuleOption(id) {
|
|
1492
1502
|
const option = this.moduleOptionMap.get(id);
|
|
@@ -1504,10 +1514,27 @@ var PluginContextData = class {
|
|
|
1504
1514
|
const bindingInfo = context.getModuleInfo(id);
|
|
1505
1515
|
if (bindingInfo) {
|
|
1506
1516
|
const info = transformModuleInfo(bindingInfo, this.getModuleOption(id));
|
|
1507
|
-
return info;
|
|
1517
|
+
return this.proxyModuleInfo(id, info);
|
|
1508
1518
|
}
|
|
1509
1519
|
return null;
|
|
1510
1520
|
}
|
|
1521
|
+
proxyModuleInfo(id, info) {
|
|
1522
|
+
let moduleSideEffects = info.moduleSideEffects;
|
|
1523
|
+
Object.defineProperty(info, "moduleSideEffects", {
|
|
1524
|
+
get() {
|
|
1525
|
+
return moduleSideEffects;
|
|
1526
|
+
},
|
|
1527
|
+
set: (v$1) => {
|
|
1528
|
+
this.updateModuleOption(id, {
|
|
1529
|
+
moduleSideEffects: v$1,
|
|
1530
|
+
meta: info.meta,
|
|
1531
|
+
invalidate: true
|
|
1532
|
+
});
|
|
1533
|
+
moduleSideEffects = v$1;
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1536
|
+
return info;
|
|
1537
|
+
}
|
|
1511
1538
|
getModuleIds(context) {
|
|
1512
1539
|
const moduleIds = context.getModuleIds();
|
|
1513
1540
|
return moduleIds.values();
|
|
@@ -1568,7 +1595,17 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog,
|
|
|
1568
1595
|
watch: bindingifyWatch(inputOptions.watch),
|
|
1569
1596
|
dropLabels: inputOptions.dropLabels,
|
|
1570
1597
|
keepNames: inputOptions.keepNames,
|
|
1571
|
-
checks: inputOptions.checks
|
|
1598
|
+
checks: inputOptions.checks,
|
|
1599
|
+
deferSyncScanData: () => {
|
|
1600
|
+
let ret = [];
|
|
1601
|
+
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
1602
|
+
if (value.invalidate) ret.push({
|
|
1603
|
+
id: key,
|
|
1604
|
+
sideEffects: bindingifySideEffects(value.moduleSideEffects)
|
|
1605
|
+
});
|
|
1606
|
+
});
|
|
1607
|
+
return ret;
|
|
1608
|
+
}
|
|
1572
1609
|
};
|
|
1573
1610
|
}
|
|
1574
1611
|
function bindingifyExternal(external) {
|
|
@@ -2645,7 +2682,7 @@ const watch = (input) => {
|
|
|
2645
2682
|
|
|
2646
2683
|
//#endregion
|
|
2647
2684
|
//#region package.json
|
|
2648
|
-
var version = "1.0.0-beta.3-commit.
|
|
2685
|
+
var version = "1.0.0-beta.3-commit.f65bde3";
|
|
2649
2686
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2650
2687
|
|
|
2651
2688
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_binding = require('./binding-
|
|
3
|
+
const require_binding = require('./binding-DTKqYZn-.cjs');
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_buffer = require_chunk.__toESM(require("node:buffer"));
|
|
6
6
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
@@ -759,7 +759,8 @@ var PluginContext = class extends MinimalPluginContext {
|
|
|
759
759
|
if (moduleInfo && moduleInfo.code !== null) return moduleInfo;
|
|
760
760
|
const rawOptions = {
|
|
761
761
|
meta: options.meta || {},
|
|
762
|
-
moduleSideEffects: options.moduleSideEffects || null
|
|
762
|
+
moduleSideEffects: options.moduleSideEffects || null,
|
|
763
|
+
invalidate: false
|
|
763
764
|
};
|
|
764
765
|
this.data.updateModuleOption(id, rawOptions);
|
|
765
766
|
async function createLoadModulePromise(context, data) {
|
|
@@ -978,14 +979,15 @@ function bindingifyResolveId(args) {
|
|
|
978
979
|
external: true
|
|
979
980
|
};
|
|
980
981
|
if (typeof ret === "string") return { id: ret };
|
|
981
|
-
args.pluginContextData.updateModuleOption(ret.id, {
|
|
982
|
+
let exist = args.pluginContextData.updateModuleOption(ret.id, {
|
|
982
983
|
meta: ret.meta || {},
|
|
983
|
-
moduleSideEffects: ret.moduleSideEffects
|
|
984
|
+
moduleSideEffects: ret.moduleSideEffects ?? null,
|
|
985
|
+
invalidate: false
|
|
984
986
|
});
|
|
985
987
|
return {
|
|
986
988
|
id: ret.id,
|
|
987
989
|
external: ret.external,
|
|
988
|
-
sideEffects: bindingifySideEffects(
|
|
990
|
+
sideEffects: bindingifySideEffects(exist.moduleSideEffects)
|
|
989
991
|
};
|
|
990
992
|
},
|
|
991
993
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -1012,7 +1014,8 @@ function bindingifyResolveDynamicImport(args) {
|
|
|
1012
1014
|
if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
|
|
1013
1015
|
args.pluginContextData.updateModuleOption(ret.id, {
|
|
1014
1016
|
meta: ret.meta || {},
|
|
1015
|
-
moduleSideEffects: ret.moduleSideEffects || null
|
|
1017
|
+
moduleSideEffects: ret.moduleSideEffects || null,
|
|
1018
|
+
invalidate: false
|
|
1016
1019
|
});
|
|
1017
1020
|
return result;
|
|
1018
1021
|
},
|
|
@@ -1028,14 +1031,15 @@ function bindingifyTransform(args) {
|
|
|
1028
1031
|
const ret = await handler.call(new TransformPluginContext(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel), code, id, meta$1);
|
|
1029
1032
|
if (ret == null) return void 0;
|
|
1030
1033
|
if (typeof ret === "string") return { code: ret };
|
|
1031
|
-
args.pluginContextData.updateModuleOption(id, {
|
|
1032
|
-
meta: ret.meta
|
|
1033
|
-
moduleSideEffects: ret.moduleSideEffects
|
|
1034
|
+
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
1035
|
+
meta: ret.meta ?? {},
|
|
1036
|
+
moduleSideEffects: ret.moduleSideEffects ?? null,
|
|
1037
|
+
invalidate: false
|
|
1034
1038
|
});
|
|
1035
1039
|
return {
|
|
1036
1040
|
code: ret.code,
|
|
1037
1041
|
map: bindingifySourcemap$1(normalizeTransformHookSourcemap(id, code, ret.map)),
|
|
1038
|
-
sideEffects: bindingifySideEffects(
|
|
1042
|
+
sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects),
|
|
1039
1043
|
moduleType: ret.moduleType
|
|
1040
1044
|
};
|
|
1041
1045
|
},
|
|
@@ -1052,16 +1056,17 @@ function bindingifyLoad(args) {
|
|
|
1052
1056
|
const ret = await handler.call(new PluginContext(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, id), id);
|
|
1053
1057
|
if (ret == null) return;
|
|
1054
1058
|
if (typeof ret === "string") return { code: ret };
|
|
1055
|
-
args.pluginContextData.updateModuleOption(id, {
|
|
1059
|
+
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
1056
1060
|
meta: ret.meta || {},
|
|
1057
|
-
moduleSideEffects: ret.moduleSideEffects
|
|
1061
|
+
moduleSideEffects: ret.moduleSideEffects ?? null,
|
|
1062
|
+
invalidate: false
|
|
1058
1063
|
});
|
|
1059
1064
|
let map = preProcessSourceMap(ret, id);
|
|
1060
1065
|
return {
|
|
1061
1066
|
code: ret.code,
|
|
1062
1067
|
map: bindingifySourcemap$1(map),
|
|
1063
1068
|
moduleType: ret.moduleType,
|
|
1064
|
-
sideEffects: bindingifySideEffects(
|
|
1069
|
+
sideEffects: bindingifySideEffects(moduleOption.moduleSideEffects)
|
|
1065
1070
|
};
|
|
1066
1071
|
},
|
|
1067
1072
|
meta: bindingifyPluginHookMeta(meta),
|
|
@@ -1488,7 +1493,12 @@ var PluginContextData = class {
|
|
|
1488
1493
|
if (existing) {
|
|
1489
1494
|
if (option.moduleSideEffects != null) existing.moduleSideEffects = option.moduleSideEffects;
|
|
1490
1495
|
if (option.meta != null) Object.assign(existing.meta, option.meta);
|
|
1491
|
-
|
|
1496
|
+
if (option.invalidate != null) existing.invalidate = option.invalidate;
|
|
1497
|
+
} else {
|
|
1498
|
+
this.moduleOptionMap.set(id, option);
|
|
1499
|
+
return option;
|
|
1500
|
+
}
|
|
1501
|
+
return existing;
|
|
1492
1502
|
}
|
|
1493
1503
|
getModuleOption(id) {
|
|
1494
1504
|
const option = this.moduleOptionMap.get(id);
|
|
@@ -1506,10 +1516,27 @@ var PluginContextData = class {
|
|
|
1506
1516
|
const bindingInfo = context.getModuleInfo(id);
|
|
1507
1517
|
if (bindingInfo) {
|
|
1508
1518
|
const info = transformModuleInfo(bindingInfo, this.getModuleOption(id));
|
|
1509
|
-
return info;
|
|
1519
|
+
return this.proxyModuleInfo(id, info);
|
|
1510
1520
|
}
|
|
1511
1521
|
return null;
|
|
1512
1522
|
}
|
|
1523
|
+
proxyModuleInfo(id, info) {
|
|
1524
|
+
let moduleSideEffects = info.moduleSideEffects;
|
|
1525
|
+
Object.defineProperty(info, "moduleSideEffects", {
|
|
1526
|
+
get() {
|
|
1527
|
+
return moduleSideEffects;
|
|
1528
|
+
},
|
|
1529
|
+
set: (v) => {
|
|
1530
|
+
this.updateModuleOption(id, {
|
|
1531
|
+
moduleSideEffects: v,
|
|
1532
|
+
meta: info.meta,
|
|
1533
|
+
invalidate: true
|
|
1534
|
+
});
|
|
1535
|
+
moduleSideEffects = v;
|
|
1536
|
+
}
|
|
1537
|
+
});
|
|
1538
|
+
return info;
|
|
1539
|
+
}
|
|
1513
1540
|
getModuleIds(context) {
|
|
1514
1541
|
const moduleIds = context.getModuleIds();
|
|
1515
1542
|
return moduleIds.values();
|
|
@@ -1570,7 +1597,17 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, onLog,
|
|
|
1570
1597
|
watch: bindingifyWatch(inputOptions.watch),
|
|
1571
1598
|
dropLabels: inputOptions.dropLabels,
|
|
1572
1599
|
keepNames: inputOptions.keepNames,
|
|
1573
|
-
checks: inputOptions.checks
|
|
1600
|
+
checks: inputOptions.checks,
|
|
1601
|
+
deferSyncScanData: () => {
|
|
1602
|
+
let ret = [];
|
|
1603
|
+
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
1604
|
+
if (value.invalidate) ret.push({
|
|
1605
|
+
id: key,
|
|
1606
|
+
sideEffects: bindingifySideEffects(value.moduleSideEffects)
|
|
1607
|
+
});
|
|
1608
|
+
});
|
|
1609
|
+
return ret;
|
|
1610
|
+
}
|
|
1574
1611
|
};
|
|
1575
1612
|
}
|
|
1576
1613
|
function bindingifyExternal(external) {
|
|
@@ -2647,7 +2684,7 @@ const watch = (input) => {
|
|
|
2647
2684
|
|
|
2648
2685
|
//#endregion
|
|
2649
2686
|
//#region package.json
|
|
2650
|
-
var version = "1.0.0-beta.3-commit.
|
|
2687
|
+
var version = "1.0.0-beta.3-commit.f65bde3";
|
|
2651
2688
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2652
2689
|
|
|
2653
2690
|
//#endregion
|
package/dist/types/binding.d.ts
CHANGED
|
@@ -287,6 +287,12 @@ export interface BindingChecksOptions {
|
|
|
287
287
|
circularDependency?: boolean
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
+
export interface BindingDeferSyncScanData {
|
|
291
|
+
/** ModuleId */
|
|
292
|
+
id: string
|
|
293
|
+
sideEffects?: BindingHookSideEffects
|
|
294
|
+
}
|
|
295
|
+
|
|
290
296
|
export interface BindingEmittedAsset {
|
|
291
297
|
name?: string
|
|
292
298
|
fileName?: string
|
|
@@ -411,6 +417,7 @@ export interface BindingInputOptions {
|
|
|
411
417
|
watch?: BindingWatchOption
|
|
412
418
|
keepNames?: boolean
|
|
413
419
|
checks?: BindingChecksOptions
|
|
420
|
+
deferSyncScanData?: undefined | (() => BindingDeferSyncScanData[])
|
|
414
421
|
}
|
|
415
422
|
|
|
416
423
|
export interface BindingJsonPluginConfig {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './op
|
|
|
3
3
|
import type { ModuleFormat, OutputOptions, PreRenderedAsset } from './options/output-options';
|
|
4
4
|
import type { RolldownOptions } from './types/rolldown-options';
|
|
5
5
|
import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, RolldownPluginOption, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin';
|
|
6
|
+
import type { LogOrStringHandler } from './log/logging';
|
|
6
7
|
import { DefineParallelPluginResult } from './plugin/parallel-plugin';
|
|
7
8
|
import { defineConfig } from './utils/define-config';
|
|
8
9
|
import { rolldown } from './api/rolldown';
|
|
@@ -16,7 +17,7 @@ import { PreRenderedChunk } from './binding';
|
|
|
16
17
|
import { PartialNull } from './types/utils';
|
|
17
18
|
import { NormalizedInputOptions } from './options/normalized-input-options';
|
|
18
19
|
import { ModuleInfo } from './types/module-info';
|
|
19
|
-
import { MinimalPluginContext } from './plugin/minimal-plugin-context';
|
|
20
|
+
import { PluginContextMeta, MinimalPluginContext } from './plugin/minimal-plugin-context';
|
|
20
21
|
import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap';
|
|
21
22
|
import { OutputBundle } from './types/output-bundle';
|
|
22
23
|
import { WatchOptions } from './options/watch-options';
|
|
@@ -24,5 +25,5 @@ import { RolldownWatcher } from './api/watch/watch-emitter';
|
|
|
24
25
|
import { build, type BuildOptions } from './api/build';
|
|
25
26
|
export { defineConfig, rolldown, watch, build };
|
|
26
27
|
export declare const VERSION: string;
|
|
27
|
-
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, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, PreRenderedAsset, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, RolldownWatcher, BuildOptions, RenderedChunk, };
|
|
28
|
-
export type { RollupError, RollupLog, LoggingFunction } from './types/misc';
|
|
28
|
+
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, 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, };
|
|
29
|
+
export type { RollupError, RollupLog, LoggingFunction, LogLevel, WarningHandlerWithDefault, } from './types/misc';
|
|
@@ -3,6 +3,7 @@ export type LogLevelOption = LogLevel | 'silent';
|
|
|
3
3
|
export type LogLevelWithError = LogLevel | 'error';
|
|
4
4
|
export type RollupLog = any;
|
|
5
5
|
export type RollupLogWithString = RollupLog | string;
|
|
6
|
+
export type LogOrStringHandler = (level: LogLevelWithError, log: RollupLogWithString) => void;
|
|
6
7
|
export declare const LOG_LEVEL_SILENT: LogLevelOption;
|
|
7
8
|
export declare const LOG_LEVEL_ERROR = "error";
|
|
8
9
|
export declare const LOG_LEVEL_WARN: LogLevel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RolldownPluginOption } from '../plugin';
|
|
2
|
-
import type { LogLevel, LogLevelOption,
|
|
2
|
+
import type { LogLevel, LogLevelOption, LogOrStringHandler, RollupLog, RollupLogWithString } from '../log/logging';
|
|
3
3
|
import type { NullValue, StringOrRegExp } from '../types/utils';
|
|
4
4
|
import type { TreeshakingOptions } from '../types/module-side-effects';
|
|
5
5
|
export type InputOption = string | string[] | Record<string, string>;
|
|
@@ -66,7 +66,7 @@ export interface InputOptions {
|
|
|
66
66
|
shimMissingExports?: boolean;
|
|
67
67
|
treeshake?: boolean | TreeshakingOptions;
|
|
68
68
|
logLevel?: LogLevelOption;
|
|
69
|
-
onLog?: (level: LogLevel, log: RollupLog, defaultHandler:
|
|
69
|
+
onLog?: (level: LogLevel, log: RollupLog, defaultHandler: LogOrStringHandler) => void;
|
|
70
70
|
onwarn?: (warning: RollupLog, defaultHandler: (warning: RollupLogWithString | (() => RollupLogWithString)) => void) => void;
|
|
71
71
|
moduleTypes?: ModuleTypes;
|
|
72
72
|
experimental?: {
|
|
@@ -6,9 +6,10 @@ export declare class PluginContextData {
|
|
|
6
6
|
moduleOptionMap: Map<string, ModuleOptions>;
|
|
7
7
|
resolveOptionsMap: Map<number, PluginContextResolveOptions>;
|
|
8
8
|
loadModulePromiseMap: Map<string, Promise<void>>;
|
|
9
|
-
updateModuleOption(id: string, option: ModuleOptions):
|
|
9
|
+
updateModuleOption(id: string, option: ModuleOptions): ModuleOptions;
|
|
10
10
|
getModuleOption(id: string): ModuleOptions;
|
|
11
11
|
getModuleInfo(id: string, context: BindingPluginContext): ModuleInfo | null;
|
|
12
|
+
proxyModuleInfo(id: string, info: ModuleInfo): ModuleInfo;
|
|
12
13
|
getModuleIds(context: BindingPluginContext): ArrayIterator<string>;
|
|
13
14
|
saveResolveOptions(options: PluginContextResolveOptions): number;
|
|
14
15
|
getSavedResolveOptions(receipt: number): PluginContextResolveOptions | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "1.0.0-beta.3-commit.
|
|
3
|
+
"version": "1.0.0-beta.3-commit.f65bde3",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"bin": {
|
|
27
27
|
"rolldown": "./bin/cli.js"
|
|
28
28
|
},
|
|
29
|
-
"type": "module",
|
|
30
29
|
"main": "./dist/cjs/index.cjs",
|
|
31
30
|
"types": "./dist/types/index.d.ts",
|
|
32
31
|
"exports": {
|
|
@@ -123,37 +122,38 @@
|
|
|
123
122
|
"unbuild": "^3.0.0",
|
|
124
123
|
"why-is-node-running": "^3.0.0",
|
|
125
124
|
"@rolldown/testing": "0.0.1",
|
|
126
|
-
"rolldown": "1.0.0-beta.3-commit.
|
|
125
|
+
"rolldown": "1.0.0-beta.3-commit.f65bde3"
|
|
127
126
|
},
|
|
128
127
|
"optionalDependencies": {
|
|
129
|
-
"@rolldown/binding-darwin-arm64": "1.0.0-beta.3-commit.
|
|
130
|
-
"@rolldown/binding-darwin-x64": "1.0.0-beta.3-commit.
|
|
131
|
-
"@rolldown/binding-
|
|
132
|
-
"@rolldown/binding-
|
|
133
|
-
"@rolldown/binding-linux-arm64-
|
|
134
|
-
"@rolldown/binding-linux-arm64-
|
|
135
|
-
"@rolldown/binding-linux-x64-
|
|
136
|
-
"@rolldown/binding-
|
|
137
|
-
"@rolldown/binding-
|
|
138
|
-
"@rolldown/binding-win32-
|
|
139
|
-
"@rolldown/binding-win32-
|
|
140
|
-
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.3-commit.
|
|
128
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.3-commit.f65bde3",
|
|
129
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.3-commit.f65bde3",
|
|
130
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.3-commit.f65bde3",
|
|
131
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.3-commit.f65bde3",
|
|
132
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.3-commit.f65bde3",
|
|
133
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.3-commit.f65bde3",
|
|
134
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.3-commit.f65bde3",
|
|
135
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.3-commit.f65bde3",
|
|
136
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.3-commit.f65bde3",
|
|
137
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.3-commit.f65bde3",
|
|
138
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.3-commit.f65bde3",
|
|
139
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.3-commit.f65bde3"
|
|
141
140
|
},
|
|
142
141
|
"scripts": {
|
|
143
142
|
"# Scrips for binding #": "_",
|
|
144
143
|
"artifacts": "napi artifacts --cwd ./src --package-json-path ../package.json -o=../artifacts --npm-dir ../npm",
|
|
145
|
-
"build-binding": "napi build -o=./src --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.
|
|
144
|
+
"build-binding": "napi build -o=./src --manifest-path ../../crates/rolldown_binding/Cargo.toml --platform -p rolldown_binding --js binding.js --dts binding.d.ts --no-const-enum",
|
|
146
145
|
"build-binding:release": "pnpm build-binding --release",
|
|
147
146
|
"build-binding:wasi": "pnpm build-binding --target wasm32-wasip1-threads",
|
|
148
147
|
"build-binding:wasi:release": "pnpm build-binding --profile release-wasi --target wasm32-wasip1-threads",
|
|
149
148
|
"# Scrips for node #": "_",
|
|
150
149
|
"bak_build-node": "unbuild",
|
|
151
|
-
"build-node": "
|
|
150
|
+
"build-node": "tsx ./build.ts",
|
|
152
151
|
"build-types": "tsc -p ./tsconfig.json",
|
|
153
|
-
"build-native:debug": "run-s build-binding build-types build-node",
|
|
154
|
-
"build-native:release": "run-s build-binding:release build-types build-node",
|
|
152
|
+
"build-native:debug": "run-s build-binding build-types build-node build-types-check",
|
|
153
|
+
"build-native:release": "run-s build-binding:release build-types build-node build-types-check",
|
|
155
154
|
"build-wasi:debug": "run-s build-binding build-binding:wasi build-node",
|
|
156
155
|
"build-wasi:release": "run-s build-binding build-binding:wasi:release build-node",
|
|
156
|
+
"build-types-check": "tsc -p ./tsconfig.check.json",
|
|
157
157
|
"# Scrips for docs #": "_",
|
|
158
158
|
"extract-options-doc": "typedoc"
|
|
159
159
|
}
|
package/dist/types/api/build.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { rolldown } from './rolldown';
|
|
2
|
-
async function build(options) {
|
|
3
|
-
if (Array.isArray(options)) {
|
|
4
|
-
return Promise.all(options.map((opts) => build(opts)));
|
|
5
|
-
}
|
|
6
|
-
else {
|
|
7
|
-
const { output, write = true, ...inputOptions } = options;
|
|
8
|
-
const build = await rolldown(inputOptions);
|
|
9
|
-
try {
|
|
10
|
-
if (write) {
|
|
11
|
-
return await build.write(output);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
return await build.generate(output);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
finally {
|
|
18
|
-
await build.close();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export { build };
|