@rolldown/browser 1.0.0-beta.8-commit.2a5c6a6 → 1.0.0-beta.8-commit.66f4623
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +11 -124
- package/dist/cli.mjs +5 -122
- package/dist/config.cjs +13 -0
- package/dist/config.d.cts +11 -0
- package/dist/config.d.mts +11 -0
- package/dist/config.mjs +12 -0
- package/dist/experimental-index.browser.mjs +1 -1
- package/dist/experimental-index.cjs +20 -20
- package/dist/experimental-index.d.cts +1 -1
- package/dist/experimental-index.d.mts +1 -1
- package/dist/experimental-index.mjs +1 -1
- package/dist/filter-index.cjs +9 -9
- package/dist/filter-index.d.cts +1 -1
- package/dist/filter-index.d.mts +1 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/parallel-plugin-worker.cjs +1 -1
- package/dist/parallel-plugin-worker.mjs +1 -1
- package/dist/parallel-plugin.cjs +1 -1
- package/dist/parallel-plugin.d.cts +1 -1
- package/dist/parallel-plugin.d.mts +1 -1
- package/dist/parse-ast-index.cjs +2 -2
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{input-options.d-CGEZtOCG.d.cts → define-config.d-Bkkf8Fak.d.cts} +23 -23
- package/dist/shared/{input-options.d-dGH7EYeL.d.mts → define-config.d-zt5s72Z7.d.mts} +23 -23
- package/dist/shared/load-config-BeUD2pZG.cjs +126 -0
- package/dist/shared/load-config-fBqyX9b3.mjs +124 -0
- package/dist/shared/{prompt-At99RuKY.cjs → prompt-jvA1XQOy.cjs} +1 -1
- package/dist/shared/{src-DRYDMwBc.cjs → src-D1iw4mNX.cjs} +1 -1
- package/dist/shared/{src-eizE6mpJ.mjs → src-ULAQDVII.mjs} +2 -2
- package/dist/{src-0gz2hYtr.js → src-NnyoYQ2w.js} +1 -1
- package/package.json +1 -1
- /package/dist/shared/{prompt-BqVpALUY.mjs → prompt-GFYxfPw7.mjs} +0 -0
package/dist/cli.cjs
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
|
|
2
|
-
const require_src = require('./shared/src-
|
|
2
|
+
const require_src = require('./shared/src-D1iw4mNX.cjs');
|
|
3
3
|
const require_dist = require('./shared/dist-n1rVcJ5K.cjs');
|
|
4
4
|
require('./shared/parse-ast-index-DfDBeJFi.cjs');
|
|
5
|
+
const require_load_config = require('./shared/load-config-BeUD2pZG.cjs');
|
|
5
6
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
6
7
|
const ansis = require_chunk.__toESM(require("ansis"));
|
|
7
|
-
const node_url = require_chunk.__toESM(require("node:url"));
|
|
8
8
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
9
9
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
10
10
|
const node_tty = require_chunk.__toESM(require("node:tty"));
|
|
11
11
|
const node_perf_hooks = require_chunk.__toESM(require("node:perf_hooks"));
|
|
12
|
-
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
13
|
-
const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
|
|
14
12
|
|
|
15
13
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
16
14
|
const LogLevels = {
|
|
@@ -400,8 +398,8 @@ function createConsola$1(options$1 = {}) {
|
|
|
400
398
|
//#endregion
|
|
401
399
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
|
|
402
400
|
function parseStack(stack, message) {
|
|
403
|
-
const cwd
|
|
404
|
-
const lines = stack.split("\n").splice(message.split("\n").length).map((l$1) => l$1.trim().replace("file://", "").replace(cwd
|
|
401
|
+
const cwd = process.cwd() + node_path.sep;
|
|
402
|
+
const lines = stack.split("\n").splice(message.split("\n").length).map((l$1) => l$1.trim().replace("file://", "").replace(cwd, ""));
|
|
405
403
|
return lines;
|
|
406
404
|
}
|
|
407
405
|
function writeStream(data, stream) {
|
|
@@ -971,7 +969,7 @@ function createConsola(options$1 = {}) {
|
|
|
971
969
|
// Terminus (<0.2.27)
|
|
972
970
|
// ConEmu and cmder
|
|
973
971
|
function() {
|
|
974
|
-
return require("./shared/prompt-
|
|
972
|
+
return require("./shared/prompt-jvA1XQOy.cjs");
|
|
975
973
|
}
|
|
976
974
|
).then((m) => m.prompt(...args)),
|
|
977
975
|
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
@@ -1079,8 +1077,8 @@ function flattenSchema(schema, base = {}, parent = "") {
|
|
|
1079
1077
|
}
|
|
1080
1078
|
return base;
|
|
1081
1079
|
}
|
|
1082
|
-
function setNestedProperty(obj, path$
|
|
1083
|
-
const keys = path$
|
|
1080
|
+
function setNestedProperty(obj, path$1, value) {
|
|
1081
|
+
const keys = path$1.split(".");
|
|
1084
1082
|
let current = obj;
|
|
1085
1083
|
for (let i$1 = 0; i$1 < keys.length - 1; i$1++) {
|
|
1086
1084
|
if (!current[keys[i$1]]) current[keys[i$1]] = {};
|
|
@@ -1448,117 +1446,6 @@ var SignalExit = class extends SignalExitBase {
|
|
|
1448
1446
|
const process$2 = globalThis.process;
|
|
1449
1447
|
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
1450
1448
|
|
|
1451
|
-
//#endregion
|
|
1452
|
-
//#region src/cli/load-config.ts
|
|
1453
|
-
async function bundleTsConfig(configFile, isEsm) {
|
|
1454
|
-
const dirnameVarName = "injected_original_dirname";
|
|
1455
|
-
const filenameVarName = "injected_original_filename";
|
|
1456
|
-
const importMetaUrlVarName = "injected_original_import_meta_url";
|
|
1457
|
-
const bundle = await require_src.rolldown({
|
|
1458
|
-
input: configFile,
|
|
1459
|
-
platform: "node",
|
|
1460
|
-
resolve: { mainFields: ["main"] },
|
|
1461
|
-
define: {
|
|
1462
|
-
__dirname: dirnameVarName,
|
|
1463
|
-
__filename: filenameVarName,
|
|
1464
|
-
"import.meta.url": importMetaUrlVarName,
|
|
1465
|
-
"import.meta.dirname": dirnameVarName,
|
|
1466
|
-
"import.meta.filename": filenameVarName
|
|
1467
|
-
},
|
|
1468
|
-
treeshake: false,
|
|
1469
|
-
external: [/^[\w@][^:]/],
|
|
1470
|
-
plugins: [{
|
|
1471
|
-
name: "inject-file-scope-variables",
|
|
1472
|
-
transform: {
|
|
1473
|
-
filter: { id: /\.[cm]?[jt]s$/ },
|
|
1474
|
-
async handler(code, id) {
|
|
1475
|
-
const injectValues = `const ${dirnameVarName} = ${JSON.stringify(node_path.default.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify((0, node_url.pathToFileURL)(id).href)};`;
|
|
1476
|
-
return {
|
|
1477
|
-
code: injectValues + code,
|
|
1478
|
-
map: null
|
|
1479
|
-
};
|
|
1480
|
-
}
|
|
1481
|
-
}
|
|
1482
|
-
}]
|
|
1483
|
-
});
|
|
1484
|
-
const outputDir = node_path.default.dirname(configFile);
|
|
1485
|
-
const result = await bundle.write({
|
|
1486
|
-
dir: outputDir,
|
|
1487
|
-
format: isEsm ? "esm" : "cjs",
|
|
1488
|
-
sourcemap: "inline",
|
|
1489
|
-
entryFileNames: `rolldown.config.[hash]${node_path.default.extname(configFile).replace("ts", "js")}`
|
|
1490
|
-
});
|
|
1491
|
-
const fileName = result.output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
1492
|
-
return node_path.default.join(outputDir, fileName);
|
|
1493
|
-
}
|
|
1494
|
-
const SUPPORTED_JS_CONFIG_FORMATS = [
|
|
1495
|
-
".js",
|
|
1496
|
-
".mjs",
|
|
1497
|
-
".cjs"
|
|
1498
|
-
];
|
|
1499
|
-
const SUPPORTED_TS_CONFIG_FORMATS = [
|
|
1500
|
-
".ts",
|
|
1501
|
-
".mts",
|
|
1502
|
-
".cts"
|
|
1503
|
-
];
|
|
1504
|
-
const SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
|
1505
|
-
const DEFAULT_CONFIG_BASE = "rolldown.config";
|
|
1506
|
-
async function findConfigFileNameInCwd() {
|
|
1507
|
-
const filesInWorkingDirectory = new Set(await (0, node_fs_promises.readdir)((0, node_process.cwd)()));
|
|
1508
|
-
for (const extension of SUPPORTED_CONFIG_FORMATS) {
|
|
1509
|
-
const fileName = `${DEFAULT_CONFIG_BASE}${extension}`;
|
|
1510
|
-
if (filesInWorkingDirectory.has(fileName)) return fileName;
|
|
1511
|
-
}
|
|
1512
|
-
throw new Error("No `rolldown.config` configuration file found.");
|
|
1513
|
-
}
|
|
1514
|
-
async function loadTsConfig(configFile) {
|
|
1515
|
-
const isEsm = isFilePathESM(configFile);
|
|
1516
|
-
const file = await bundleTsConfig(configFile, isEsm);
|
|
1517
|
-
try {
|
|
1518
|
-
return (await import((0, node_url.pathToFileURL)(file).href)).default;
|
|
1519
|
-
} finally {
|
|
1520
|
-
node_fs.default.unlink(file, () => {});
|
|
1521
|
-
}
|
|
1522
|
-
}
|
|
1523
|
-
function isFilePathESM(filePath) {
|
|
1524
|
-
if (/\.m[jt]s$/.test(filePath)) return true;
|
|
1525
|
-
else if (/\.c[jt]s$/.test(filePath)) return false;
|
|
1526
|
-
else {
|
|
1527
|
-
const pkg = findNearestPackageData(node_path.default.dirname(filePath));
|
|
1528
|
-
if (pkg) return pkg.type === "module";
|
|
1529
|
-
return false;
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
function findNearestPackageData(basedir) {
|
|
1533
|
-
while (basedir) {
|
|
1534
|
-
const pkgPath = node_path.default.join(basedir, "package.json");
|
|
1535
|
-
if (tryStatSync(pkgPath)?.isFile()) try {
|
|
1536
|
-
return JSON.parse(node_fs.default.readFileSync(pkgPath, "utf-8"));
|
|
1537
|
-
} catch {}
|
|
1538
|
-
const nextBasedir = node_path.default.dirname(basedir);
|
|
1539
|
-
if (nextBasedir === basedir) break;
|
|
1540
|
-
basedir = nextBasedir;
|
|
1541
|
-
}
|
|
1542
|
-
return null;
|
|
1543
|
-
}
|
|
1544
|
-
function tryStatSync(file) {
|
|
1545
|
-
try {
|
|
1546
|
-
return node_fs.default.statSync(file, { throwIfNoEntry: false });
|
|
1547
|
-
} catch {}
|
|
1548
|
-
}
|
|
1549
|
-
async function loadConfig(configPath) {
|
|
1550
|
-
const ext = node_path.default.extname(configPath = configPath || await findConfigFileNameInCwd());
|
|
1551
|
-
try {
|
|
1552
|
-
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import((0, node_url.pathToFileURL)(configPath).href)).default;
|
|
1553
|
-
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) {
|
|
1554
|
-
const rawConfigPath = node_path.default.resolve(configPath);
|
|
1555
|
-
return await loadTsConfig(rawConfigPath);
|
|
1556
|
-
} else throw new Error(`Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${ext}\``);
|
|
1557
|
-
} catch (err) {
|
|
1558
|
-
throw new Error("Error happened while loading config.", { cause: err });
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
1449
|
//#endregion
|
|
1563
1450
|
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.69.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
|
|
1564
1451
|
var require_usingCtx = require_chunk.__commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.69.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
|
|
@@ -1627,7 +1514,7 @@ async function bundleWithConfig(configPath, cliOptions) {
|
|
|
1627
1514
|
process.env.ROLLUP_WATCH = "true";
|
|
1628
1515
|
process.env.ROLLDOWN_WATCH = "true";
|
|
1629
1516
|
}
|
|
1630
|
-
const config = await loadConfig(configPath);
|
|
1517
|
+
const config = await require_load_config.loadConfig(configPath);
|
|
1631
1518
|
if (!config) {
|
|
1632
1519
|
logger.error(`No configuration found at ${config}`);
|
|
1633
1520
|
process.exit(1);
|
|
@@ -1784,9 +1671,9 @@ function printOutputEntries(entries, sizeAdjustment, distPath) {
|
|
|
1784
1671
|
}
|
|
1785
1672
|
}
|
|
1786
1673
|
}
|
|
1787
|
-
function withTrailingSlash(path$
|
|
1788
|
-
if (path$
|
|
1789
|
-
return path$
|
|
1674
|
+
function withTrailingSlash(path$1) {
|
|
1675
|
+
if (path$1[path$1.length - 1] !== "/") return `${path$1}/`;
|
|
1676
|
+
return path$1;
|
|
1790
1677
|
}
|
|
1791
1678
|
function ms(duration) {
|
|
1792
1679
|
return duration < 1e3 ? `${duration.toFixed(2)} ms` : `${(duration / 1e3).toFixed(2)} s`;
|
package/dist/cli.mjs
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { __commonJS, __esm, __toESM } from "./shared/chunk-DSsiIF1Z.mjs";
|
|
2
|
-
import { description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-
|
|
2
|
+
import { description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-ULAQDVII.mjs";
|
|
3
3
|
import { arraify, init_misc } from "./shared/dist-Oaz_A_8i.mjs";
|
|
4
4
|
import "./shared/parse-ast-index-DvsltErM.mjs";
|
|
5
|
+
import { init_load_config, loadConfig } from "./shared/load-config-fBqyX9b3.mjs";
|
|
5
6
|
import path, { sep } from "node:path";
|
|
6
7
|
import colors from "ansis";
|
|
7
|
-
import
|
|
8
|
-
import process$1, { cwd } from "node:process";
|
|
8
|
+
import process$1 from "node:process";
|
|
9
9
|
import { formatWithOptions, parseArgs } from "node:util";
|
|
10
10
|
import * as tty from "node:tty";
|
|
11
11
|
import { performance } from "node:perf_hooks";
|
|
12
|
-
import fs from "node:fs";
|
|
13
|
-
import { readdir } from "node:fs/promises";
|
|
14
12
|
|
|
15
13
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
16
14
|
function isPlainObject$1(value) {
|
|
@@ -761,7 +759,7 @@ function createConsola(options$1 = {}) {
|
|
|
761
759
|
defaults: { level },
|
|
762
760
|
stdout: process.stdout,
|
|
763
761
|
stderr: process.stderr,
|
|
764
|
-
prompt: (...args) => import("./shared/prompt-
|
|
762
|
+
prompt: (...args) => import("./shared/prompt-GFYxfPw7.mjs").then((m) => m.prompt(...args)),
|
|
765
763
|
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
766
764
|
...options$1
|
|
767
765
|
});
|
|
@@ -1449,121 +1447,6 @@ var init_mjs = __esm({ "../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/
|
|
|
1449
1447
|
({onExit, load, unload} = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback()));
|
|
1450
1448
|
} });
|
|
1451
1449
|
|
|
1452
|
-
//#endregion
|
|
1453
|
-
//#region src/cli/load-config.ts
|
|
1454
|
-
async function bundleTsConfig(configFile, isEsm) {
|
|
1455
|
-
const dirnameVarName = "injected_original_dirname";
|
|
1456
|
-
const filenameVarName = "injected_original_filename";
|
|
1457
|
-
const importMetaUrlVarName = "injected_original_import_meta_url";
|
|
1458
|
-
const bundle = await rolldown({
|
|
1459
|
-
input: configFile,
|
|
1460
|
-
platform: "node",
|
|
1461
|
-
resolve: { mainFields: ["main"] },
|
|
1462
|
-
define: {
|
|
1463
|
-
__dirname: dirnameVarName,
|
|
1464
|
-
__filename: filenameVarName,
|
|
1465
|
-
"import.meta.url": importMetaUrlVarName,
|
|
1466
|
-
"import.meta.dirname": dirnameVarName,
|
|
1467
|
-
"import.meta.filename": filenameVarName
|
|
1468
|
-
},
|
|
1469
|
-
treeshake: false,
|
|
1470
|
-
external: [/^[\w@][^:]/],
|
|
1471
|
-
plugins: [{
|
|
1472
|
-
name: "inject-file-scope-variables",
|
|
1473
|
-
transform: {
|
|
1474
|
-
filter: { id: /\.[cm]?[jt]s$/ },
|
|
1475
|
-
async handler(code, id) {
|
|
1476
|
-
const injectValues = `const ${dirnameVarName} = ${JSON.stringify(path.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(id).href)};`;
|
|
1477
|
-
return {
|
|
1478
|
-
code: injectValues + code,
|
|
1479
|
-
map: null
|
|
1480
|
-
};
|
|
1481
|
-
}
|
|
1482
|
-
}
|
|
1483
|
-
}]
|
|
1484
|
-
});
|
|
1485
|
-
const outputDir = path.dirname(configFile);
|
|
1486
|
-
const result = await bundle.write({
|
|
1487
|
-
dir: outputDir,
|
|
1488
|
-
format: isEsm ? "esm" : "cjs",
|
|
1489
|
-
sourcemap: "inline",
|
|
1490
|
-
entryFileNames: `rolldown.config.[hash]${path.extname(configFile).replace("ts", "js")}`
|
|
1491
|
-
});
|
|
1492
|
-
const fileName = result.output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
1493
|
-
return path.join(outputDir, fileName);
|
|
1494
|
-
}
|
|
1495
|
-
async function findConfigFileNameInCwd() {
|
|
1496
|
-
const filesInWorkingDirectory = new Set(await readdir(cwd()));
|
|
1497
|
-
for (const extension of SUPPORTED_CONFIG_FORMATS) {
|
|
1498
|
-
const fileName = `${DEFAULT_CONFIG_BASE}${extension}`;
|
|
1499
|
-
if (filesInWorkingDirectory.has(fileName)) return fileName;
|
|
1500
|
-
}
|
|
1501
|
-
throw new Error("No `rolldown.config` configuration file found.");
|
|
1502
|
-
}
|
|
1503
|
-
async function loadTsConfig(configFile) {
|
|
1504
|
-
const isEsm = isFilePathESM(configFile);
|
|
1505
|
-
const file = await bundleTsConfig(configFile, isEsm);
|
|
1506
|
-
try {
|
|
1507
|
-
return (await import(pathToFileURL(file).href)).default;
|
|
1508
|
-
} finally {
|
|
1509
|
-
fs.unlink(file, () => {});
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
function isFilePathESM(filePath) {
|
|
1513
|
-
if (/\.m[jt]s$/.test(filePath)) return true;
|
|
1514
|
-
else if (/\.c[jt]s$/.test(filePath)) return false;
|
|
1515
|
-
else {
|
|
1516
|
-
const pkg = findNearestPackageData(path.dirname(filePath));
|
|
1517
|
-
if (pkg) return pkg.type === "module";
|
|
1518
|
-
return false;
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
function findNearestPackageData(basedir) {
|
|
1522
|
-
while (basedir) {
|
|
1523
|
-
const pkgPath = path.join(basedir, "package.json");
|
|
1524
|
-
if (tryStatSync(pkgPath)?.isFile()) try {
|
|
1525
|
-
return JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
1526
|
-
} catch {}
|
|
1527
|
-
const nextBasedir = path.dirname(basedir);
|
|
1528
|
-
if (nextBasedir === basedir) break;
|
|
1529
|
-
basedir = nextBasedir;
|
|
1530
|
-
}
|
|
1531
|
-
return null;
|
|
1532
|
-
}
|
|
1533
|
-
function tryStatSync(file) {
|
|
1534
|
-
try {
|
|
1535
|
-
return fs.statSync(file, { throwIfNoEntry: false });
|
|
1536
|
-
} catch {}
|
|
1537
|
-
}
|
|
1538
|
-
async function loadConfig(configPath) {
|
|
1539
|
-
const ext = path.extname(configPath = configPath || await findConfigFileNameInCwd());
|
|
1540
|
-
try {
|
|
1541
|
-
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import(pathToFileURL(configPath).href)).default;
|
|
1542
|
-
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) {
|
|
1543
|
-
const rawConfigPath = path.resolve(configPath);
|
|
1544
|
-
return await loadTsConfig(rawConfigPath);
|
|
1545
|
-
} else throw new Error(`Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${ext}\``);
|
|
1546
|
-
} catch (err) {
|
|
1547
|
-
throw new Error("Error happened while loading config.", { cause: err });
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
var SUPPORTED_JS_CONFIG_FORMATS, SUPPORTED_TS_CONFIG_FORMATS, SUPPORTED_CONFIG_FORMATS, DEFAULT_CONFIG_BASE;
|
|
1551
|
-
var init_load_config = __esm({ "src/cli/load-config.ts"() {
|
|
1552
|
-
init_rolldown();
|
|
1553
|
-
SUPPORTED_JS_CONFIG_FORMATS = [
|
|
1554
|
-
".js",
|
|
1555
|
-
".mjs",
|
|
1556
|
-
".cjs"
|
|
1557
|
-
];
|
|
1558
|
-
SUPPORTED_TS_CONFIG_FORMATS = [
|
|
1559
|
-
".ts",
|
|
1560
|
-
".mts",
|
|
1561
|
-
".cts"
|
|
1562
|
-
];
|
|
1563
|
-
SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
|
1564
|
-
DEFAULT_CONFIG_BASE = "rolldown.config";
|
|
1565
|
-
} });
|
|
1566
|
-
|
|
1567
1450
|
//#endregion
|
|
1568
1451
|
//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.69.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
|
|
1569
1452
|
var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.69.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
|
|
@@ -1793,8 +1676,8 @@ var init_bundle = __esm({ "src/cli/commands/bundle.ts"() {
|
|
|
1793
1676
|
init_mjs();
|
|
1794
1677
|
init_rolldown();
|
|
1795
1678
|
init_watch();
|
|
1796
|
-
init_misc();
|
|
1797
1679
|
init_load_config();
|
|
1680
|
+
init_misc();
|
|
1798
1681
|
init_logger();
|
|
1799
1682
|
import_usingCtx = __toESM(require_usingCtx());
|
|
1800
1683
|
numberFormatter = new Intl.NumberFormat("en", {
|
package/dist/config.cjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const require_src = require('./shared/src-D1iw4mNX.cjs');
|
|
3
|
+
require('./shared/dist-n1rVcJ5K.cjs');
|
|
4
|
+
require('./shared/parse-ast-index-DfDBeJFi.cjs');
|
|
5
|
+
const require_load_config = require('./shared/load-config-BeUD2pZG.cjs');
|
|
6
|
+
|
|
7
|
+
//#region src/config.ts
|
|
8
|
+
const VERSION = require_src.version;
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.VERSION = VERSION;
|
|
12
|
+
exports.defineConfig = require_src.defineConfig;
|
|
13
|
+
exports.loadConfig = require_load_config.loadConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConfigExport, defineConfig } from "./shared/define-config.d-Bkkf8Fak.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/load-config.d.ts
|
|
4
|
+
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/config.d.ts
|
|
8
|
+
declare const VERSION: string;
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { VERSION, defineConfig, loadConfig };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConfigExport, defineConfig$1 as defineConfig } from "./shared/define-config.d-zt5s72Z7.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/load-config.d.ts
|
|
4
|
+
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/config.d.ts
|
|
8
|
+
declare const VERSION: string;
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { VERSION, defineConfig, loadConfig };
|
package/dist/config.mjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig, init_define_config, version } from "./shared/src-ULAQDVII.mjs";
|
|
2
|
+
import "./shared/dist-Oaz_A_8i.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-DvsltErM.mjs";
|
|
4
|
+
import { init_load_config, loadConfig } from "./shared/load-config-fBqyX9b3.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/config.ts
|
|
7
|
+
init_define_config();
|
|
8
|
+
init_load_config();
|
|
9
|
+
const VERSION = version;
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { VERSION, defineConfig, loadConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./src-
|
|
1
|
+
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./src-NnyoYQ2w.js";
|
|
2
2
|
import { ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
|
|
3
3
|
|
|
4
4
|
//#region src/api/experimental.ts
|
|
@@ -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-D1iw4mNX.cjs');
|
|
4
4
|
require('./shared/dist-n1rVcJ5K.cjs');
|
|
5
5
|
require('./shared/parse-ast-index-DfDBeJFi.cjs');
|
|
6
6
|
const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
|
|
@@ -89,40 +89,40 @@ Object.defineProperty(exports, 'ResolverFactory', {
|
|
|
89
89
|
return src_rolldown_binding_wasi_cjs.ResolverFactory;
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
exports.aliasPlugin = aliasPlugin
|
|
93
|
-
exports.buildImportAnalysisPlugin = require_src.buildImportAnalysisPlugin
|
|
94
|
-
exports.composePlugins = require_src.composeJsPlugins
|
|
95
|
-
exports.defineParallelPlugin = defineParallelPlugin
|
|
96
|
-
exports.dynamicImportVarsPlugin = require_src.dynamicImportVarsPlugin
|
|
97
|
-
exports.importGlobPlugin = require_src.importGlobPlugin
|
|
92
|
+
exports.aliasPlugin = aliasPlugin;
|
|
93
|
+
exports.buildImportAnalysisPlugin = require_src.buildImportAnalysisPlugin;
|
|
94
|
+
exports.composePlugins = require_src.composeJsPlugins;
|
|
95
|
+
exports.defineParallelPlugin = defineParallelPlugin;
|
|
96
|
+
exports.dynamicImportVarsPlugin = require_src.dynamicImportVarsPlugin;
|
|
97
|
+
exports.importGlobPlugin = require_src.importGlobPlugin;
|
|
98
98
|
Object.defineProperty(exports, 'isolatedDeclaration', {
|
|
99
99
|
enumerable: true,
|
|
100
100
|
get: function () {
|
|
101
101
|
return src_rolldown_binding_wasi_cjs.isolatedDeclaration;
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
exports.isolatedDeclarationPlugin = require_src.isolatedDeclarationPlugin
|
|
105
|
-
exports.jsonPlugin = require_src.jsonPlugin
|
|
106
|
-
exports.loadFallbackPlugin = require_src.loadFallbackPlugin
|
|
107
|
-
exports.manifestPlugin = require_src.manifestPlugin
|
|
108
|
-
exports.moduleFederationPlugin = require_src.moduleFederationPlugin
|
|
109
|
-
exports.modulePreloadPolyfillPlugin = require_src.modulePreloadPolyfillPlugin
|
|
104
|
+
exports.isolatedDeclarationPlugin = require_src.isolatedDeclarationPlugin;
|
|
105
|
+
exports.jsonPlugin = require_src.jsonPlugin;
|
|
106
|
+
exports.loadFallbackPlugin = require_src.loadFallbackPlugin;
|
|
107
|
+
exports.manifestPlugin = require_src.manifestPlugin;
|
|
108
|
+
exports.moduleFederationPlugin = require_src.moduleFederationPlugin;
|
|
109
|
+
exports.modulePreloadPolyfillPlugin = require_src.modulePreloadPolyfillPlugin;
|
|
110
110
|
Object.defineProperty(exports, 'moduleRunnerTransform', {
|
|
111
111
|
enumerable: true,
|
|
112
112
|
get: function () {
|
|
113
113
|
return src_rolldown_binding_wasi_cjs.moduleRunnerTransform;
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
|
-
exports.replacePlugin = replacePlugin
|
|
117
|
-
exports.reportPlugin = require_src.reportPlugin
|
|
118
|
-
exports.scan = experimental_scan
|
|
116
|
+
exports.replacePlugin = replacePlugin;
|
|
117
|
+
exports.reportPlugin = require_src.reportPlugin;
|
|
118
|
+
exports.scan = experimental_scan;
|
|
119
119
|
Object.defineProperty(exports, 'transform', {
|
|
120
120
|
enumerable: true,
|
|
121
121
|
get: function () {
|
|
122
122
|
return src_rolldown_binding_wasi_cjs.transform;
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
|
-
exports.transformPlugin = transformPlugin
|
|
126
|
-
exports.viteResolvePlugin = require_src.viteResolvePlugin
|
|
127
|
-
exports.wasmFallbackPlugin = require_src.wasmFallbackPlugin
|
|
128
|
-
exports.wasmHelperPlugin = require_src.wasmHelperPlugin
|
|
125
|
+
exports.transformPlugin = transformPlugin;
|
|
126
|
+
exports.viteResolvePlugin = require_src.viteResolvePlugin;
|
|
127
|
+
exports.wasmFallbackPlugin = require_src.wasmFallbackPlugin;
|
|
128
|
+
exports.wasmHelperPlugin = require_src.wasmHelperPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/
|
|
1
|
+
import { BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/define-config.d-Bkkf8Fak.cjs";
|
|
2
2
|
import { BindingReplacePluginConfig, BindingTransformPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions as ResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/experimental.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPlugin$1 as BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin$1 as buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin$1 as dynamicImportVarsPlugin, importGlobPlugin$1 as importGlobPlugin, isolatedDeclarationPlugin$1 as isolatedDeclarationPlugin, jsonPlugin$1 as jsonPlugin, loadFallbackPlugin$1 as loadFallbackPlugin, manifestPlugin$1 as manifestPlugin, moduleFederationPlugin$1 as moduleFederationPlugin, modulePreloadPolyfillPlugin$1 as modulePreloadPolyfillPlugin, reportPlugin$1 as reportPlugin, viteResolvePlugin$1 as viteResolvePlugin, wasmFallbackPlugin$1 as wasmFallbackPlugin, wasmHelperPlugin$1 as wasmHelperPlugin } from "./shared/
|
|
1
|
+
import { BuiltinPlugin$1 as BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin$1 as buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin$1 as dynamicImportVarsPlugin, importGlobPlugin$1 as importGlobPlugin, isolatedDeclarationPlugin$1 as isolatedDeclarationPlugin, jsonPlugin$1 as jsonPlugin, loadFallbackPlugin$1 as loadFallbackPlugin, manifestPlugin$1 as manifestPlugin, moduleFederationPlugin$1 as moduleFederationPlugin, modulePreloadPolyfillPlugin$1 as modulePreloadPolyfillPlugin, reportPlugin$1 as reportPlugin, viteResolvePlugin$1 as viteResolvePlugin, wasmFallbackPlugin$1 as wasmFallbackPlugin, wasmHelperPlugin$1 as wasmHelperPlugin } from "./shared/define-config.d-zt5s72Z7.mjs";
|
|
2
2
|
import { BindingReplacePluginConfig, BindingTransformPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions as ResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/experimental.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_normalize_string_or_regex, init_transform_to_rollup_output, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/src-
|
|
1
|
+
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_normalize_string_or_regex, init_transform_to_rollup_output, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/src-ULAQDVII.mjs";
|
|
2
2
|
import "./shared/dist-Oaz_A_8i.mjs";
|
|
3
3
|
import "./shared/parse-ast-index-DvsltErM.mjs";
|
|
4
4
|
import { ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
package/dist/filter-index.cjs
CHANGED
|
@@ -41,12 +41,12 @@ function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
|
-
exports.and = require_dist.and
|
|
45
|
-
exports.code = require_dist.code
|
|
46
|
-
exports.exclude = require_dist.exclude
|
|
47
|
-
exports.id = require_dist.id
|
|
48
|
-
exports.include = require_dist.include
|
|
49
|
-
exports.moduleType = require_dist.moduleType
|
|
50
|
-
exports.not = require_dist.not
|
|
51
|
-
exports.or = require_dist.or
|
|
52
|
-
exports.withFilter = withFilter
|
|
44
|
+
exports.and = require_dist.and;
|
|
45
|
+
exports.code = require_dist.code;
|
|
46
|
+
exports.exclude = require_dist.exclude;
|
|
47
|
+
exports.id = require_dist.id;
|
|
48
|
+
exports.include = require_dist.include;
|
|
49
|
+
exports.moduleType = require_dist.moduleType;
|
|
50
|
+
exports.not = require_dist.not;
|
|
51
|
+
exports.or = require_dist.or;
|
|
52
|
+
exports.withFilter = withFilter;
|
package/dist/filter-index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/
|
|
1
|
+
import { and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/define-config.d-Bkkf8Fak.cjs";
|
|
2
2
|
|
|
3
3
|
export { and, code, exclude, id, include, moduleType, not, or, withFilter };
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/
|
|
1
|
+
import { and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/define-config.d-zt5s72Z7.mjs";
|
|
2
2
|
|
|
3
3
|
export { and, code, exclude, id, include, moduleType, not, or, withFilter };
|
package/dist/index.browser.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_src = require('./shared/src-
|
|
1
|
+
const require_src = require('./shared/src-D1iw4mNX.cjs');
|
|
2
2
|
require('./shared/dist-n1rVcJ5K.cjs');
|
|
3
3
|
require('./shared/parse-ast-index-DfDBeJFi.cjs');
|
|
4
4
|
|
|
5
|
-
exports.VERSION = require_src.VERSION
|
|
6
|
-
exports.build = require_src.build
|
|
7
|
-
exports.defineConfig = require_src.defineConfig
|
|
8
|
-
exports.rolldown = require_src.rolldown
|
|
9
|
-
exports.watch = require_src.watch
|
|
5
|
+
exports.VERSION = require_src.VERSION;
|
|
6
|
+
exports.build = require_src.build;
|
|
7
|
+
exports.defineConfig = require_src.defineConfig;
|
|
8
|
+
exports.rolldown = require_src.rolldown;
|
|
9
|
+
exports.watch = require_src.watch;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/
|
|
1
|
+
import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config.d-Bkkf8Fak.cjs";
|
|
2
2
|
|
|
3
|
-
export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
|
3
|
+
export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION$1 as VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build$1 as build, defineConfig$1 as defineConfig, rolldown$1 as rolldown, watch$1 as watch } from "./shared/
|
|
1
|
+
import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION$1 as VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build$1 as build, defineConfig$1 as defineConfig, rolldown$1 as rolldown, watch$1 as watch } from "./shared/define-config.d-zt5s72Z7.mjs";
|
|
2
2
|
|
|
3
|
-
export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
|
3
|
+
export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VERSION, build, defineConfig, init_src, rolldown, watch } from "./shared/src-
|
|
1
|
+
import { VERSION, build, defineConfig, init_src, rolldown, watch } from "./shared/src-ULAQDVII.mjs";
|
|
2
2
|
import "./shared/dist-Oaz_A_8i.mjs";
|
|
3
3
|
import "./shared/parse-ast-index-DvsltErM.mjs";
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
|
|
2
|
-
const require_src = require('./shared/src-
|
|
2
|
+
const require_src = require('./shared/src-D1iw4mNX.cjs');
|
|
3
3
|
require('./shared/dist-n1rVcJ5K.cjs');
|
|
4
4
|
require('./shared/parse-ast-index-DfDBeJFi.cjs');
|
|
5
5
|
const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __commonJS } from "./shared/chunk-DSsiIF1Z.mjs";
|
|
2
|
-
import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-
|
|
2
|
+
import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-ULAQDVII.mjs";
|
|
3
3
|
import "./shared/dist-Oaz_A_8i.mjs";
|
|
4
4
|
import "./shared/parse-ast-index-DvsltErM.mjs";
|
|
5
5
|
import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
package/dist/parallel-plugin.cjs
CHANGED
package/dist/parse-ast-index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const require_parse_ast_index = require('./shared/parse-ast-index-DfDBeJFi.cjs');
|
|
2
2
|
|
|
3
|
-
exports.parseAst = require_parse_ast_index.parseAst
|
|
4
|
-
exports.parseAstAsync = require_parse_ast_index.parseAstAsync
|
|
3
|
+
exports.parseAst = require_parse_ast_index.parseAst;
|
|
4
|
+
exports.parseAstAsync = require_parse_ast_index.parseAstAsync;
|
|
Binary file
|
|
@@ -624,22 +624,6 @@ interface TransformPluginContext extends PluginContext {
|
|
|
624
624
|
getCombinedSourcemap(): SourceMap;
|
|
625
625
|
}
|
|
626
626
|
|
|
627
|
-
//#endregion
|
|
628
|
-
//#region src/types/rolldown-options.d.ts
|
|
629
|
-
interface RolldownOptions extends InputOptions {
|
|
630
|
-
output?: OutputOptions | OutputOptions[];
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region src/types/config-export.d.ts
|
|
635
|
-
/**
|
|
636
|
-
* Type for `default export` of `rolldown.config.js` file.
|
|
637
|
-
*/
|
|
638
|
-
/**
|
|
639
|
-
* Type for `default export` of `rolldown.config.js` file.
|
|
640
|
-
*/
|
|
641
|
-
type ConfigExport = RolldownOptions | RolldownOptions[];
|
|
642
|
-
|
|
643
627
|
//#endregion
|
|
644
628
|
//#region src/types/module-side-effects.d.ts
|
|
645
629
|
interface ModuleSideEffectsRule {
|
|
@@ -675,12 +659,6 @@ interface ExistingRawSourceMap {
|
|
|
675
659
|
}
|
|
676
660
|
type SourceMapInput = ExistingRawSourceMap | string | null;
|
|
677
661
|
|
|
678
|
-
//#endregion
|
|
679
|
-
//#region src/utils/define-config.d.ts
|
|
680
|
-
declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
681
|
-
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
682
|
-
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
683
|
-
|
|
684
662
|
//#endregion
|
|
685
663
|
//#region src/index.d.ts
|
|
686
664
|
declare const VERSION: string;
|
|
@@ -1134,4 +1112,26 @@ interface InputOptions {
|
|
|
1134
1112
|
}
|
|
1135
1113
|
|
|
1136
1114
|
//#endregion
|
|
1137
|
-
|
|
1115
|
+
//#region src/types/rolldown-options.d.ts
|
|
1116
|
+
interface RolldownOptions extends InputOptions {
|
|
1117
|
+
output?: OutputOptions | OutputOptions[];
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
//#endregion
|
|
1121
|
+
//#region src/types/config-export.d.ts
|
|
1122
|
+
/**
|
|
1123
|
+
* Type for `default export` of `rolldown.config.js` file.
|
|
1124
|
+
*/
|
|
1125
|
+
/**
|
|
1126
|
+
* Type for `default export` of `rolldown.config.js` file.
|
|
1127
|
+
*/
|
|
1128
|
+
type ConfigExport = RolldownOptions | RolldownOptions[];
|
|
1129
|
+
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region src/utils/define-config.d.ts
|
|
1132
|
+
declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
1133
|
+
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
1134
|
+
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
1135
|
+
|
|
1136
|
+
//#endregion
|
|
1137
|
+
export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk$1 as PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, and, build, buildImportAnalysisPlugin, code, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, exclude, id, importGlobPlugin, include, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, moduleType, not, or, reportPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, withFilter };
|
|
@@ -624,22 +624,6 @@ interface TransformPluginContext extends PluginContext {
|
|
|
624
624
|
getCombinedSourcemap(): SourceMap;
|
|
625
625
|
}
|
|
626
626
|
|
|
627
|
-
//#endregion
|
|
628
|
-
//#region src/types/rolldown-options.d.ts
|
|
629
|
-
interface RolldownOptions extends InputOptions {
|
|
630
|
-
output?: OutputOptions | OutputOptions[];
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region src/types/config-export.d.ts
|
|
635
|
-
/**
|
|
636
|
-
* Type for `default export` of `rolldown.config.js` file.
|
|
637
|
-
*/
|
|
638
|
-
/**
|
|
639
|
-
* Type for `default export` of `rolldown.config.js` file.
|
|
640
|
-
*/
|
|
641
|
-
type ConfigExport = RolldownOptions | RolldownOptions[];
|
|
642
|
-
|
|
643
627
|
//#endregion
|
|
644
628
|
//#region src/types/module-side-effects.d.ts
|
|
645
629
|
interface ModuleSideEffectsRule {
|
|
@@ -675,12 +659,6 @@ interface ExistingRawSourceMap {
|
|
|
675
659
|
}
|
|
676
660
|
type SourceMapInput = ExistingRawSourceMap | string | null;
|
|
677
661
|
|
|
678
|
-
//#endregion
|
|
679
|
-
//#region src/utils/define-config.d.ts
|
|
680
|
-
declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
681
|
-
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
682
|
-
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
683
|
-
|
|
684
662
|
//#endregion
|
|
685
663
|
//#region src/index.d.ts
|
|
686
664
|
declare const VERSION: string;
|
|
@@ -1134,4 +1112,26 @@ interface InputOptions {
|
|
|
1134
1112
|
}
|
|
1135
1113
|
|
|
1136
1114
|
//#endregion
|
|
1137
|
-
|
|
1115
|
+
//#region src/types/rolldown-options.d.ts
|
|
1116
|
+
interface RolldownOptions extends InputOptions {
|
|
1117
|
+
output?: OutputOptions | OutputOptions[];
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
//#endregion
|
|
1121
|
+
//#region src/types/config-export.d.ts
|
|
1122
|
+
/**
|
|
1123
|
+
* Type for `default export` of `rolldown.config.js` file.
|
|
1124
|
+
*/
|
|
1125
|
+
/**
|
|
1126
|
+
* Type for `default export` of `rolldown.config.js` file.
|
|
1127
|
+
*/
|
|
1128
|
+
type ConfigExport = RolldownOptions | RolldownOptions[];
|
|
1129
|
+
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region src/utils/define-config.d.ts
|
|
1132
|
+
declare function defineConfig(config: RolldownOptions): RolldownOptions;
|
|
1133
|
+
declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
1134
|
+
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
1135
|
+
|
|
1136
|
+
//#endregion
|
|
1137
|
+
export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin as BuiltinPlugin$1, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk$1 as PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION as VERSION$1, WarningHandlerWithDefault, WatchOptions, WatcherOptions, and, build as build$1, buildImportAnalysisPlugin as buildImportAnalysisPlugin$1, code, defineConfig as defineConfig$1, defineParallelPlugin, dynamicImportVarsPlugin as dynamicImportVarsPlugin$1, exclude, id, importGlobPlugin as importGlobPlugin$1, include, isolatedDeclarationPlugin as isolatedDeclarationPlugin$1, jsonPlugin as jsonPlugin$1, loadFallbackPlugin as loadFallbackPlugin$1, manifestPlugin as manifestPlugin$1, moduleFederationPlugin as moduleFederationPlugin$1, modulePreloadPolyfillPlugin as modulePreloadPolyfillPlugin$1, moduleType, not, or, reportPlugin as reportPlugin$1, rolldown as rolldown$1, viteResolvePlugin as viteResolvePlugin$1, wasmFallbackPlugin as wasmFallbackPlugin$1, wasmHelperPlugin as wasmHelperPlugin$1, watch as watch$1, withFilter };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
|
+
const require_src = require('./src-D1iw4mNX.cjs');
|
|
4
|
+
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
|
+
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
|
+
const node_process = require_chunk.__toESM(require("node:process"));
|
|
7
|
+
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
8
|
+
const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
|
|
9
|
+
|
|
10
|
+
//#region src/utils/load-config.ts
|
|
11
|
+
async function bundleTsConfig(configFile, isEsm) {
|
|
12
|
+
const dirnameVarName = "injected_original_dirname";
|
|
13
|
+
const filenameVarName = "injected_original_filename";
|
|
14
|
+
const importMetaUrlVarName = "injected_original_import_meta_url";
|
|
15
|
+
const bundle = await require_src.rolldown({
|
|
16
|
+
input: configFile,
|
|
17
|
+
platform: "node",
|
|
18
|
+
resolve: { mainFields: ["main"] },
|
|
19
|
+
define: {
|
|
20
|
+
__dirname: dirnameVarName,
|
|
21
|
+
__filename: filenameVarName,
|
|
22
|
+
"import.meta.url": importMetaUrlVarName,
|
|
23
|
+
"import.meta.dirname": dirnameVarName,
|
|
24
|
+
"import.meta.filename": filenameVarName
|
|
25
|
+
},
|
|
26
|
+
treeshake: false,
|
|
27
|
+
external: [/^[\w@][^:]/],
|
|
28
|
+
plugins: [{
|
|
29
|
+
name: "inject-file-scope-variables",
|
|
30
|
+
transform: {
|
|
31
|
+
filter: { id: /\.[cm]?[jt]s$/ },
|
|
32
|
+
async handler(code, id) {
|
|
33
|
+
const injectValues = `const ${dirnameVarName} = ${JSON.stringify(node_path.default.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify((0, node_url.pathToFileURL)(id).href)};`;
|
|
34
|
+
return {
|
|
35
|
+
code: injectValues + code,
|
|
36
|
+
map: null
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}]
|
|
41
|
+
});
|
|
42
|
+
const outputDir = node_path.default.dirname(configFile);
|
|
43
|
+
const result = await bundle.write({
|
|
44
|
+
dir: outputDir,
|
|
45
|
+
format: isEsm ? "esm" : "cjs",
|
|
46
|
+
sourcemap: "inline",
|
|
47
|
+
entryFileNames: `rolldown.config.[hash]${node_path.default.extname(configFile).replace("ts", "js")}`
|
|
48
|
+
});
|
|
49
|
+
const fileName = result.output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
50
|
+
return node_path.default.join(outputDir, fileName);
|
|
51
|
+
}
|
|
52
|
+
const SUPPORTED_JS_CONFIG_FORMATS = [
|
|
53
|
+
".js",
|
|
54
|
+
".mjs",
|
|
55
|
+
".cjs"
|
|
56
|
+
];
|
|
57
|
+
const SUPPORTED_TS_CONFIG_FORMATS = [
|
|
58
|
+
".ts",
|
|
59
|
+
".mts",
|
|
60
|
+
".cts"
|
|
61
|
+
];
|
|
62
|
+
const SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
|
63
|
+
const DEFAULT_CONFIG_BASE = "rolldown.config";
|
|
64
|
+
async function findConfigFileNameInCwd() {
|
|
65
|
+
const filesInWorkingDirectory = new Set(await (0, node_fs_promises.readdir)((0, node_process.cwd)()));
|
|
66
|
+
for (const extension of SUPPORTED_CONFIG_FORMATS) {
|
|
67
|
+
const fileName = `${DEFAULT_CONFIG_BASE}${extension}`;
|
|
68
|
+
if (filesInWorkingDirectory.has(fileName)) return fileName;
|
|
69
|
+
}
|
|
70
|
+
throw new Error("No `rolldown.config` configuration file found.");
|
|
71
|
+
}
|
|
72
|
+
async function loadTsConfig(configFile) {
|
|
73
|
+
const isEsm = isFilePathESM(configFile);
|
|
74
|
+
const file = await bundleTsConfig(configFile, isEsm);
|
|
75
|
+
try {
|
|
76
|
+
return (await import((0, node_url.pathToFileURL)(file).href)).default;
|
|
77
|
+
} finally {
|
|
78
|
+
node_fs.default.unlink(file, () => {});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function isFilePathESM(filePath) {
|
|
82
|
+
if (/\.m[jt]s$/.test(filePath)) return true;
|
|
83
|
+
else if (/\.c[jt]s$/.test(filePath)) return false;
|
|
84
|
+
else {
|
|
85
|
+
const pkg = findNearestPackageData(node_path.default.dirname(filePath));
|
|
86
|
+
if (pkg) return pkg.type === "module";
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function findNearestPackageData(basedir) {
|
|
91
|
+
while (basedir) {
|
|
92
|
+
const pkgPath = node_path.default.join(basedir, "package.json");
|
|
93
|
+
if (tryStatSync(pkgPath)?.isFile()) try {
|
|
94
|
+
return JSON.parse(node_fs.default.readFileSync(pkgPath, "utf-8"));
|
|
95
|
+
} catch {}
|
|
96
|
+
const nextBasedir = node_path.default.dirname(basedir);
|
|
97
|
+
if (nextBasedir === basedir) break;
|
|
98
|
+
basedir = nextBasedir;
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
function tryStatSync(file) {
|
|
103
|
+
try {
|
|
104
|
+
return node_fs.default.statSync(file, { throwIfNoEntry: false });
|
|
105
|
+
} catch {}
|
|
106
|
+
}
|
|
107
|
+
async function loadConfig(configPath) {
|
|
108
|
+
const ext = node_path.default.extname(configPath = configPath || await findConfigFileNameInCwd());
|
|
109
|
+
try {
|
|
110
|
+
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import((0, node_url.pathToFileURL)(configPath).href)).default;
|
|
111
|
+
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) {
|
|
112
|
+
const rawConfigPath = node_path.default.resolve(configPath);
|
|
113
|
+
return await loadTsConfig(rawConfigPath);
|
|
114
|
+
} else throw new Error(`Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${ext}\``);
|
|
115
|
+
} catch (err) {
|
|
116
|
+
throw new Error("Error happened while loading config.", { cause: err });
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
Object.defineProperty(exports, 'loadConfig', {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: function () {
|
|
124
|
+
return loadConfig;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { __esm } from "./chunk-DSsiIF1Z.mjs";
|
|
2
|
+
import { init_rolldown, rolldown } from "./src-ULAQDVII.mjs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
import { cwd } from "node:process";
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import { readdir } from "node:fs/promises";
|
|
8
|
+
|
|
9
|
+
//#region src/utils/load-config.ts
|
|
10
|
+
async function bundleTsConfig(configFile, isEsm) {
|
|
11
|
+
const dirnameVarName = "injected_original_dirname";
|
|
12
|
+
const filenameVarName = "injected_original_filename";
|
|
13
|
+
const importMetaUrlVarName = "injected_original_import_meta_url";
|
|
14
|
+
const bundle = await rolldown({
|
|
15
|
+
input: configFile,
|
|
16
|
+
platform: "node",
|
|
17
|
+
resolve: { mainFields: ["main"] },
|
|
18
|
+
define: {
|
|
19
|
+
__dirname: dirnameVarName,
|
|
20
|
+
__filename: filenameVarName,
|
|
21
|
+
"import.meta.url": importMetaUrlVarName,
|
|
22
|
+
"import.meta.dirname": dirnameVarName,
|
|
23
|
+
"import.meta.filename": filenameVarName
|
|
24
|
+
},
|
|
25
|
+
treeshake: false,
|
|
26
|
+
external: [/^[\w@][^:]/],
|
|
27
|
+
plugins: [{
|
|
28
|
+
name: "inject-file-scope-variables",
|
|
29
|
+
transform: {
|
|
30
|
+
filter: { id: /\.[cm]?[jt]s$/ },
|
|
31
|
+
async handler(code, id) {
|
|
32
|
+
const injectValues = `const ${dirnameVarName} = ${JSON.stringify(path.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(id).href)};`;
|
|
33
|
+
return {
|
|
34
|
+
code: injectValues + code,
|
|
35
|
+
map: null
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}]
|
|
40
|
+
});
|
|
41
|
+
const outputDir = path.dirname(configFile);
|
|
42
|
+
const result = await bundle.write({
|
|
43
|
+
dir: outputDir,
|
|
44
|
+
format: isEsm ? "esm" : "cjs",
|
|
45
|
+
sourcemap: "inline",
|
|
46
|
+
entryFileNames: `rolldown.config.[hash]${path.extname(configFile).replace("ts", "js")}`
|
|
47
|
+
});
|
|
48
|
+
const fileName = result.output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
|
49
|
+
return path.join(outputDir, fileName);
|
|
50
|
+
}
|
|
51
|
+
async function findConfigFileNameInCwd() {
|
|
52
|
+
const filesInWorkingDirectory = new Set(await readdir(cwd()));
|
|
53
|
+
for (const extension of SUPPORTED_CONFIG_FORMATS) {
|
|
54
|
+
const fileName = `${DEFAULT_CONFIG_BASE}${extension}`;
|
|
55
|
+
if (filesInWorkingDirectory.has(fileName)) return fileName;
|
|
56
|
+
}
|
|
57
|
+
throw new Error("No `rolldown.config` configuration file found.");
|
|
58
|
+
}
|
|
59
|
+
async function loadTsConfig(configFile) {
|
|
60
|
+
const isEsm = isFilePathESM(configFile);
|
|
61
|
+
const file = await bundleTsConfig(configFile, isEsm);
|
|
62
|
+
try {
|
|
63
|
+
return (await import(pathToFileURL(file).href)).default;
|
|
64
|
+
} finally {
|
|
65
|
+
fs.unlink(file, () => {});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function isFilePathESM(filePath) {
|
|
69
|
+
if (/\.m[jt]s$/.test(filePath)) return true;
|
|
70
|
+
else if (/\.c[jt]s$/.test(filePath)) return false;
|
|
71
|
+
else {
|
|
72
|
+
const pkg = findNearestPackageData(path.dirname(filePath));
|
|
73
|
+
if (pkg) return pkg.type === "module";
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function findNearestPackageData(basedir) {
|
|
78
|
+
while (basedir) {
|
|
79
|
+
const pkgPath = path.join(basedir, "package.json");
|
|
80
|
+
if (tryStatSync(pkgPath)?.isFile()) try {
|
|
81
|
+
return JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
82
|
+
} catch {}
|
|
83
|
+
const nextBasedir = path.dirname(basedir);
|
|
84
|
+
if (nextBasedir === basedir) break;
|
|
85
|
+
basedir = nextBasedir;
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
function tryStatSync(file) {
|
|
90
|
+
try {
|
|
91
|
+
return fs.statSync(file, { throwIfNoEntry: false });
|
|
92
|
+
} catch {}
|
|
93
|
+
}
|
|
94
|
+
async function loadConfig(configPath) {
|
|
95
|
+
const ext = path.extname(configPath = configPath || await findConfigFileNameInCwd());
|
|
96
|
+
try {
|
|
97
|
+
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import(pathToFileURL(configPath).href)).default;
|
|
98
|
+
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) {
|
|
99
|
+
const rawConfigPath = path.resolve(configPath);
|
|
100
|
+
return await loadTsConfig(rawConfigPath);
|
|
101
|
+
} else throw new Error(`Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${ext}\``);
|
|
102
|
+
} catch (err) {
|
|
103
|
+
throw new Error("Error happened while loading config.", { cause: err });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
var SUPPORTED_JS_CONFIG_FORMATS, SUPPORTED_TS_CONFIG_FORMATS, SUPPORTED_CONFIG_FORMATS, DEFAULT_CONFIG_BASE;
|
|
107
|
+
var init_load_config = __esm({ "src/utils/load-config.ts"() {
|
|
108
|
+
init_rolldown();
|
|
109
|
+
SUPPORTED_JS_CONFIG_FORMATS = [
|
|
110
|
+
".js",
|
|
111
|
+
".mjs",
|
|
112
|
+
".cjs"
|
|
113
|
+
];
|
|
114
|
+
SUPPORTED_TS_CONFIG_FORMATS = [
|
|
115
|
+
".ts",
|
|
116
|
+
".mts",
|
|
117
|
+
".cts"
|
|
118
|
+
];
|
|
119
|
+
SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
|
120
|
+
DEFAULT_CONFIG_BASE = "rolldown.config";
|
|
121
|
+
} });
|
|
122
|
+
|
|
123
|
+
//#endregion
|
|
124
|
+
export { init_load_config, loadConfig };
|
|
@@ -9,7 +9,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
|
|
|
9
9
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.0.0-beta.8-commit.
|
|
12
|
+
var version = "1.0.0-beta.8-commit.66f4623";
|
|
13
13
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
@@ -8,7 +8,7 @@ import { availableParallelism } from "node:os";
|
|
|
8
8
|
import { Worker } from "node:worker_threads";
|
|
9
9
|
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "1.0.0-beta.8-commit.
|
|
11
|
+
var version = "1.0.0-beta.8-commit.66f4623";
|
|
12
12
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
@@ -5775,4 +5775,4 @@ var init_src = __esm({ "src/index.ts"() {
|
|
|
5775
5775
|
} });
|
|
5776
5776
|
|
|
5777
5777
|
//#endregion
|
|
5778
|
-
export { BuiltinPlugin, PluginContextData, VERSION, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description$1 as description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, init_bindingify_plugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_normalize_string_or_regex, init_plugin_context_data, init_rolldown, init_src, init_transform_to_rollup_output, init_validator, init_watch, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };
|
|
5778
|
+
export { BuiltinPlugin, PluginContextData, VERSION, bindingifyPlugin, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, description$1 as description, dynamicImportVarsPlugin, getInputCliKeys, getJsonSchema, getOutputCliKeys, handleOutputErrors, importGlobPlugin, init_bindingify_plugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_define_config, init_normalize_string_or_regex, init_plugin_context_data, init_rolldown, init_src, init_transform_to_rollup_output, init_validator, init_watch, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, rolldown, validateCliOptions, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolldown/browser",
|
|
3
|
-
"version": "1.0.0-beta.8-commit.
|
|
3
|
+
"version": "1.0.0-beta.8-commit.66f4623",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"type": "module",
|
|
File without changes
|