@rolldown/browser 1.0.0-beta.8-commit.534fde3 → 1.0.0-beta.8-commit.e270f24
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/browser.mjs +44 -42
- package/dist/cli.cjs +9 -7
- package/dist/cli.mjs +5 -3
- package/dist/experimental-index.cjs +2 -2
- package/dist/experimental-index.d.cts +1 -1
- package/dist/experimental-index.d.mts +1 -1
- package/dist/experimental-index.mjs +2 -2
- package/dist/filter-index.cjs +51 -11
- package/dist/filter-index.d.cts +2 -2
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +47 -3
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/parallel-plugin-worker.cjs +2 -2
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.cts +1 -1
- package/dist/parallel-plugin.d.mts +1 -1
- package/dist/rolldown-binding.wasi-browser.js +1 -0
- package/dist/rolldown-binding.wasi.cjs +1 -0
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{filter-index-ChddWdsi.cjs → esm-Bpw6hef2.cjs} +7 -53
- package/dist/shared/{filter-index-DmisSKZF.mjs → esm-hYMC2_r0.mjs} +3 -53
- package/dist/shared/{input-options.d-DIb0_K9t.d.mts → input-options.d-B9wi4n3f.d.mts} +40 -36
- package/dist/shared/{input-options.d-JaQuRwQq.d.cts → input-options.d-DsS7pFhE.d.cts} +40 -36
- package/dist/shared/{src-BD62AA2R.cjs → src-Bge47TAa.cjs} +31 -29
- package/dist/shared/{src-C1eHSkk5.mjs → src-DEcj849i.mjs} +9 -7
- package/package.json +1 -1
package/dist/browser.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import path from "pathe";
|
|
|
3
3
|
import colors from "ansis";
|
|
4
4
|
|
|
5
5
|
//#region package.json
|
|
6
|
-
var version = "1.0.0-beta.8-commit.
|
|
6
|
+
var version = "1.0.0-beta.8-commit.e270f24";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/builtin-plugin/utils.ts
|
|
@@ -2001,43 +2001,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
|
|
|
2001
2001
|
}
|
|
2002
2002
|
|
|
2003
2003
|
//#endregion
|
|
2004
|
-
//#region
|
|
2005
|
-
function u$1(o, n, a) {
|
|
2006
|
-
let t$1 = (r) => o(r, ...n);
|
|
2007
|
-
return a === void 0 ? t$1 : Object.assign(t$1, {
|
|
2008
|
-
lazy: a,
|
|
2009
|
-
lazyArgs: n
|
|
2010
|
-
});
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
//#endregion
|
|
2014
|
-
//#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2015
|
-
function u(r, n, o) {
|
|
2016
|
-
let a = r.length - n.length;
|
|
2017
|
-
if (a === 0) return r(...n);
|
|
2018
|
-
if (a === 1) return u$1(r, n, o);
|
|
2019
|
-
throw new Error("Wrong number of arguments");
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
//#endregion
|
|
2023
|
-
//#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2024
|
-
function d(...r) {
|
|
2025
|
-
return u(i, r);
|
|
2026
|
-
}
|
|
2027
|
-
var i = (r, t$1) => {
|
|
2028
|
-
let a = [[], []];
|
|
2029
|
-
for (let [o, e] of r.entries()) t$1(e, o, r) ? a[0].push(e) : a[1].push(e);
|
|
2030
|
-
return a;
|
|
2031
|
-
};
|
|
2032
|
-
|
|
2033
|
-
//#endregion
|
|
2034
|
-
//#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5NQBDF4H.js
|
|
2035
|
-
function t(...n) {
|
|
2036
|
-
return u(Object.keys, n);
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
|
-
//#endregion
|
|
2040
|
-
//#region src/filter-index.ts
|
|
2004
|
+
//#region ../pluginutils/dist/esm/index.js
|
|
2041
2005
|
var And = class {
|
|
2042
2006
|
kind;
|
|
2043
2007
|
args;
|
|
@@ -2118,6 +2082,42 @@ function exclude(expr) {
|
|
|
2118
2082
|
return new Exclude(expr);
|
|
2119
2083
|
}
|
|
2120
2084
|
|
|
2085
|
+
//#endregion
|
|
2086
|
+
//#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-D6FCK2GA.js
|
|
2087
|
+
function u$1(o, n, a) {
|
|
2088
|
+
let t$1 = (r) => o(r, ...n);
|
|
2089
|
+
return a === void 0 ? t$1 : Object.assign(t$1, {
|
|
2090
|
+
lazy: a,
|
|
2091
|
+
lazyArgs: n
|
|
2092
|
+
});
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
//#endregion
|
|
2096
|
+
//#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2097
|
+
function u(r, n, o) {
|
|
2098
|
+
let a = r.length - n.length;
|
|
2099
|
+
if (a === 0) return r(...n);
|
|
2100
|
+
if (a === 1) return u$1(r, n, o);
|
|
2101
|
+
throw new Error("Wrong number of arguments");
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
//#endregion
|
|
2105
|
+
//#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2106
|
+
function d(...r) {
|
|
2107
|
+
return u(i, r);
|
|
2108
|
+
}
|
|
2109
|
+
var i = (r, t$1) => {
|
|
2110
|
+
let a = [[], []];
|
|
2111
|
+
for (let [o, e] of r.entries()) t$1(e, o, r) ? a[0].push(e) : a[1].push(e);
|
|
2112
|
+
return a;
|
|
2113
|
+
};
|
|
2114
|
+
|
|
2115
|
+
//#endregion
|
|
2116
|
+
//#region ../../node_modules/.pnpm/remeda@2.21.2/node_modules/remeda/dist/chunk-5NQBDF4H.js
|
|
2117
|
+
function t(...n) {
|
|
2118
|
+
return u(Object.keys, n);
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
2121
|
//#endregion
|
|
2122
2122
|
//#region src/plugin/bindingify-hook-filter.ts
|
|
2123
2123
|
function generalHookFilterMatcherToFilterExprs(matcher, stringKind) {
|
|
@@ -4147,18 +4147,20 @@ var WatcherEmitter = class {
|
|
|
4147
4147
|
const code$1 = event.bundleEventKind();
|
|
4148
4148
|
switch (code$1) {
|
|
4149
4149
|
case "BUNDLE_END":
|
|
4150
|
-
const { duration, output } = event.bundleEndData();
|
|
4150
|
+
const { duration, output, result } = event.bundleEndData();
|
|
4151
4151
|
await listener({
|
|
4152
4152
|
code: "BUNDLE_END",
|
|
4153
4153
|
duration,
|
|
4154
|
-
output: [output]
|
|
4154
|
+
output: [output],
|
|
4155
|
+
result
|
|
4155
4156
|
});
|
|
4156
4157
|
break;
|
|
4157
4158
|
case "ERROR":
|
|
4158
|
-
const
|
|
4159
|
+
const data = event.bundleErrorData();
|
|
4159
4160
|
await listener({
|
|
4160
4161
|
code: "ERROR",
|
|
4161
|
-
error: normalizeErrors(
|
|
4162
|
+
error: normalizeErrors(data.error),
|
|
4163
|
+
result: data.result
|
|
4162
4164
|
});
|
|
4163
4165
|
break;
|
|
4164
4166
|
default:
|
package/dist/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
|
|
2
|
-
const require_src = require('./shared/src-
|
|
3
|
-
const
|
|
2
|
+
const require_src = require('./shared/src-Bge47TAa.cjs');
|
|
3
|
+
const require_esm = require('./shared/esm-Bpw6hef2.cjs');
|
|
4
4
|
require('./shared/parse-ast-index-C4XbfZ6x.cjs');
|
|
5
5
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
6
6
|
const ansis = require_chunk.__toESM(require("ansis"));
|
|
@@ -1664,11 +1664,11 @@ async function bundleWithCliOptions(cliOptions) {
|
|
|
1664
1664
|
}
|
|
1665
1665
|
}
|
|
1666
1666
|
async function watchInner(config, cliOptions) {
|
|
1667
|
-
let normalizedConfig =
|
|
1667
|
+
let normalizedConfig = require_esm.arraify(config).map((option) => {
|
|
1668
1668
|
return {
|
|
1669
1669
|
...option,
|
|
1670
1670
|
...cliOptions.input,
|
|
1671
|
-
output:
|
|
1671
|
+
output: require_esm.arraify(option.output || {}).map((output) => {
|
|
1672
1672
|
return {
|
|
1673
1673
|
...output,
|
|
1674
1674
|
...cliOptions.output
|
|
@@ -1687,16 +1687,18 @@ async function watchInner(config, cliOptions) {
|
|
|
1687
1687
|
watcher.on("change", (id, event) => {
|
|
1688
1688
|
if (event.event === "update") changedFile.push(id);
|
|
1689
1689
|
});
|
|
1690
|
-
watcher.on("event", (event) => {
|
|
1690
|
+
watcher.on("event", async (event) => {
|
|
1691
1691
|
switch (event.code) {
|
|
1692
1692
|
case "BUNDLE_START":
|
|
1693
1693
|
if (changedFile.length > 0) logger.log(`Found ${ansis.default.bold(changedFile.map(relativeId).join(", "))} changed, rebuilding...`);
|
|
1694
1694
|
changedFile.length = 0;
|
|
1695
1695
|
break;
|
|
1696
1696
|
case "BUNDLE_END":
|
|
1697
|
+
await event.result.close();
|
|
1697
1698
|
logger.success(`Rebuilt ${ansis.default.bold(relativeId(event.output[0]))} in ${ansis.default.bold(ms(event.duration))}.`);
|
|
1698
1699
|
break;
|
|
1699
1700
|
case "ERROR":
|
|
1701
|
+
await event.result.close();
|
|
1700
1702
|
logger.error(event.error);
|
|
1701
1703
|
break;
|
|
1702
1704
|
default: break;
|
|
@@ -1707,9 +1709,9 @@ async function watchInner(config, cliOptions) {
|
|
|
1707
1709
|
async function bundleInner(config, cliOptions) {
|
|
1708
1710
|
const startTime = node_perf_hooks.performance.now();
|
|
1709
1711
|
const result = [];
|
|
1710
|
-
const configList =
|
|
1712
|
+
const configList = require_esm.arraify(config);
|
|
1711
1713
|
for (const config$1 of configList) {
|
|
1712
|
-
const outputList =
|
|
1714
|
+
const outputList = require_esm.arraify(config$1.output || {});
|
|
1713
1715
|
const build = await require_src.rolldown({
|
|
1714
1716
|
...config$1,
|
|
1715
1717
|
...cliOptions.input
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
3
|
-
import { arraify, init_misc } from "./shared/
|
|
2
|
+
import { description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-DEcj849i.mjs";
|
|
3
|
+
import { arraify, init_misc } from "./shared/esm-hYMC2_r0.mjs";
|
|
4
4
|
import "./shared/parse-ast-index-D_ZB9M77.mjs";
|
|
5
5
|
import path, { sep } from "node:path";
|
|
6
6
|
import colors from "ansis";
|
|
@@ -1692,16 +1692,18 @@ async function watchInner(config, cliOptions) {
|
|
|
1692
1692
|
watcher.on("change", (id, event) => {
|
|
1693
1693
|
if (event.event === "update") changedFile.push(id);
|
|
1694
1694
|
});
|
|
1695
|
-
watcher.on("event", (event) => {
|
|
1695
|
+
watcher.on("event", async (event) => {
|
|
1696
1696
|
switch (event.code) {
|
|
1697
1697
|
case "BUNDLE_START":
|
|
1698
1698
|
if (changedFile.length > 0) logger.log(`Found ${colors.bold(changedFile.map(relativeId).join(", "))} changed, rebuilding...`);
|
|
1699
1699
|
changedFile.length = 0;
|
|
1700
1700
|
break;
|
|
1701
1701
|
case "BUNDLE_END":
|
|
1702
|
+
await event.result.close();
|
|
1702
1703
|
logger.success(`Rebuilt ${colors.bold(relativeId(event.output[0]))} in ${colors.bold(ms(event.duration))}.`);
|
|
1703
1704
|
break;
|
|
1704
1705
|
case "ERROR":
|
|
1706
|
+
await event.result.close();
|
|
1705
1707
|
logger.error(event.error);
|
|
1706
1708
|
break;
|
|
1707
1709
|
default: break;
|
|
@@ -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
|
-
require('./shared/
|
|
3
|
+
const require_src = require('./shared/src-Bge47TAa.cjs');
|
|
4
|
+
require('./shared/esm-Bpw6hef2.cjs');
|
|
5
5
|
require('./shared/parse-ast-index-C4XbfZ6x.cjs');
|
|
6
6
|
const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
|
|
7
7
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
@@ -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/input-options.d-
|
|
1
|
+
import { BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/input-options.d-DsS7pFhE.cjs";
|
|
2
2
|
import { BindingReplacePluginConfig, BindingTransformPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, 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/input-options.d-
|
|
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/input-options.d-B9wi4n3f.mjs";
|
|
2
2
|
import { BindingReplacePluginConfig, BindingTransformPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/experimental.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
import "./shared/
|
|
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-DEcj849i.mjs";
|
|
2
|
+
import "./shared/esm-hYMC2_r0.mjs";
|
|
3
3
|
import "./shared/parse-ast-index-D_ZB9M77.mjs";
|
|
4
4
|
import { isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
package/dist/filter-index.cjs
CHANGED
|
@@ -1,12 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
const require_esm = require('./shared/esm-Bpw6hef2.cjs');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
//#region src/plugin/with-filter.ts
|
|
5
|
+
function withFilterImpl(pluginOption, filterObjectList) {
|
|
6
|
+
if (require_esm.isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
|
|
7
|
+
if (pluginOption == false || pluginOption == null) return pluginOption;
|
|
8
|
+
if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
|
|
9
|
+
let plugin = pluginOption;
|
|
10
|
+
let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
|
|
11
|
+
if (filterObjectIndex === -1) return plugin;
|
|
12
|
+
let filterObject = filterObjectList[filterObjectIndex];
|
|
13
|
+
Object.keys(plugin).forEach((key) => {
|
|
14
|
+
switch (key) {
|
|
15
|
+
case "transform":
|
|
16
|
+
case "resolveId":
|
|
17
|
+
case "load":
|
|
18
|
+
if (!plugin[key]) return;
|
|
19
|
+
if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
|
|
20
|
+
else plugin[key] = {
|
|
21
|
+
handler: plugin[key],
|
|
22
|
+
filter: filterObject[key]
|
|
23
|
+
};
|
|
24
|
+
break;
|
|
25
|
+
default: break;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return plugin;
|
|
29
|
+
}
|
|
30
|
+
function withFilter(pluginOption, filterObject) {
|
|
31
|
+
return withFilterImpl(pluginOption, require_esm.arraify(filterObject));
|
|
32
|
+
}
|
|
33
|
+
function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
|
|
34
|
+
if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
|
|
35
|
+
for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
|
|
36
|
+
let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
|
|
37
|
+
if (typeof pattern === "string" && pattern === pluginName) return i;
|
|
38
|
+
else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
|
|
39
|
+
}
|
|
40
|
+
return -1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
exports.and = require_esm.and
|
|
45
|
+
exports.code = require_esm.code
|
|
46
|
+
exports.exclude = require_esm.exclude
|
|
47
|
+
exports.id = require_esm.id
|
|
48
|
+
exports.include = require_esm.include
|
|
49
|
+
exports.moduleType = require_esm.moduleType
|
|
50
|
+
exports.not = require_esm.not
|
|
51
|
+
exports.or = require_esm.or
|
|
52
|
+
exports.withFilter = withFilter
|
package/dist/filter-index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/input-options.d-DsS7pFhE.cjs";
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { and, code, exclude, id, include, moduleType, not, or, withFilter };
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/input-options.d-B9wi4n3f.mjs";
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { and, code, exclude, id, include, moduleType, not, or, withFilter };
|
package/dist/filter-index.mjs
CHANGED
|
@@ -1,4 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { and$1 as and, arraify, code$1 as code, exclude$1 as exclude, id$1 as id, include$1 as include, init_esm, init_misc, isPromiseLike, moduleType$1 as moduleType, not$1 as not, or$1 as or } from "./shared/esm-hYMC2_r0.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
//#region src/plugin/with-filter.ts
|
|
4
|
+
init_misc();
|
|
5
|
+
function withFilterImpl(pluginOption, filterObjectList) {
|
|
6
|
+
if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
|
|
7
|
+
if (pluginOption == false || pluginOption == null) return pluginOption;
|
|
8
|
+
if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
|
|
9
|
+
let plugin = pluginOption;
|
|
10
|
+
let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
|
|
11
|
+
if (filterObjectIndex === -1) return plugin;
|
|
12
|
+
let filterObject = filterObjectList[filterObjectIndex];
|
|
13
|
+
Object.keys(plugin).forEach((key) => {
|
|
14
|
+
switch (key) {
|
|
15
|
+
case "transform":
|
|
16
|
+
case "resolveId":
|
|
17
|
+
case "load":
|
|
18
|
+
if (!plugin[key]) return;
|
|
19
|
+
if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
|
|
20
|
+
else plugin[key] = {
|
|
21
|
+
handler: plugin[key],
|
|
22
|
+
filter: filterObject[key]
|
|
23
|
+
};
|
|
24
|
+
break;
|
|
25
|
+
default: break;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return plugin;
|
|
29
|
+
}
|
|
30
|
+
function withFilter(pluginOption, filterObject) {
|
|
31
|
+
return withFilterImpl(pluginOption, arraify(filterObject));
|
|
32
|
+
}
|
|
33
|
+
function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
|
|
34
|
+
if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
|
|
35
|
+
for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
|
|
36
|
+
let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
|
|
37
|
+
if (typeof pattern === "string" && pattern === pluginName) return i;
|
|
38
|
+
else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
|
|
39
|
+
}
|
|
40
|
+
return -1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/filter-index.ts
|
|
45
|
+
init_esm();
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { and, code, exclude, id, include, moduleType, not, or, withFilter };
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_src = require('./shared/src-
|
|
2
|
-
require('./shared/
|
|
1
|
+
const require_src = require('./shared/src-Bge47TAa.cjs');
|
|
2
|
+
require('./shared/esm-Bpw6hef2.cjs');
|
|
3
3
|
require('./shared/parse-ast-index-C4XbfZ6x.cjs');
|
|
4
4
|
|
|
5
5
|
exports.VERSION = require_src.VERSION
|
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/input-options.d-
|
|
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/input-options.d-DsS7pFhE.cjs";
|
|
2
2
|
|
|
3
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 };
|
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/input-options.d-
|
|
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/input-options.d-B9wi4n3f.mjs";
|
|
2
2
|
|
|
3
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VERSION, build, defineConfig, init_src, rolldown, watch } from "./shared/src-
|
|
2
|
-
import "./shared/
|
|
1
|
+
import { VERSION, build, defineConfig, init_src, rolldown, watch } from "./shared/src-DEcj849i.mjs";
|
|
2
|
+
import "./shared/esm-hYMC2_r0.mjs";
|
|
3
3
|
import "./shared/parse-ast-index-D_ZB9M77.mjs";
|
|
4
4
|
|
|
5
5
|
init_src();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
|
|
2
|
-
const require_src = require('./shared/src-
|
|
3
|
-
require('./shared/
|
|
2
|
+
const require_src = require('./shared/src-Bge47TAa.cjs');
|
|
3
|
+
require('./shared/esm-Bpw6hef2.cjs');
|
|
4
4
|
require('./shared/parse-ast-index-C4XbfZ6x.cjs');
|
|
5
5
|
const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
|
|
6
6
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __commonJS } from "./shared/chunk-DSsiIF1Z.mjs";
|
|
2
|
-
import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-
|
|
3
|
-
import "./shared/
|
|
2
|
+
import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-DEcj849i.mjs";
|
|
3
|
+
import "./shared/esm-hYMC2_r0.mjs";
|
|
4
4
|
import "./shared/parse-ast-index-D_ZB9M77.mjs";
|
|
5
5
|
import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
|
6
6
|
import { parentPort, workerData } from "node:worker_threads";
|
|
@@ -61,6 +61,7 @@ const {
|
|
|
61
61
|
},
|
|
62
62
|
})
|
|
63
63
|
export const BindingBundleEndEventData = __napiModule.exports.BindingBundleEndEventData
|
|
64
|
+
export const BindingBundleErrorEventData = __napiModule.exports.BindingBundleErrorEventData
|
|
64
65
|
export const BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin
|
|
65
66
|
export const BindingError = __napiModule.exports.BindingError
|
|
66
67
|
export const BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
@@ -86,6 +86,7 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
|
|
|
86
86
|
})
|
|
87
87
|
|
|
88
88
|
module.exports.BindingBundleEndEventData = __napiModule.exports.BindingBundleEndEventData
|
|
89
|
+
module.exports.BindingBundleErrorEventData = __napiModule.exports.BindingBundleErrorEventData
|
|
89
90
|
module.exports.BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin
|
|
90
91
|
module.exports.BindingError = __napiModule.exports.BindingError
|
|
91
92
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
Binary file
|
|
@@ -24,47 +24,7 @@ function unsupported(info) {
|
|
|
24
24
|
function noop(..._args) {}
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
-
//#region
|
|
28
|
-
function withFilterImpl(pluginOption, filterObjectList) {
|
|
29
|
-
if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
|
|
30
|
-
if (pluginOption == false || pluginOption == null) return pluginOption;
|
|
31
|
-
if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
|
|
32
|
-
let plugin = pluginOption;
|
|
33
|
-
let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
|
|
34
|
-
if (filterObjectIndex === -1) return plugin;
|
|
35
|
-
let filterObject = filterObjectList[filterObjectIndex];
|
|
36
|
-
Object.keys(plugin).forEach((key) => {
|
|
37
|
-
switch (key) {
|
|
38
|
-
case "transform":
|
|
39
|
-
case "resolveId":
|
|
40
|
-
case "load":
|
|
41
|
-
if (!plugin[key]) return;
|
|
42
|
-
if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
|
|
43
|
-
else plugin[key] = {
|
|
44
|
-
handler: plugin[key],
|
|
45
|
-
filter: filterObject[key]
|
|
46
|
-
};
|
|
47
|
-
break;
|
|
48
|
-
default: break;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return plugin;
|
|
52
|
-
}
|
|
53
|
-
function withFilter(pluginOption, filterObject) {
|
|
54
|
-
return withFilterImpl(pluginOption, arraify(filterObject));
|
|
55
|
-
}
|
|
56
|
-
function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
|
|
57
|
-
if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
|
|
58
|
-
for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
|
|
59
|
-
let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
|
|
60
|
-
if (typeof pattern === "string" && pattern === pluginName) return i;
|
|
61
|
-
else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
|
|
62
|
-
}
|
|
63
|
-
return -1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region src/filter-index.ts
|
|
27
|
+
//#region ../pluginutils/dist/esm/index.js
|
|
68
28
|
var And = class {
|
|
69
29
|
kind;
|
|
70
30
|
args;
|
|
@@ -157,12 +117,6 @@ function exclude(expr) {
|
|
|
157
117
|
}
|
|
158
118
|
|
|
159
119
|
//#endregion
|
|
160
|
-
Object.defineProperty(exports, 'And', {
|
|
161
|
-
enumerable: true,
|
|
162
|
-
get: function () {
|
|
163
|
-
return And;
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
120
|
Object.defineProperty(exports, 'and', {
|
|
167
121
|
enumerable: true,
|
|
168
122
|
get: function () {
|
|
@@ -205,6 +159,12 @@ Object.defineProperty(exports, 'isNullish', {
|
|
|
205
159
|
return isNullish;
|
|
206
160
|
}
|
|
207
161
|
});
|
|
162
|
+
Object.defineProperty(exports, 'isPromiseLike', {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return isPromiseLike;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
208
168
|
Object.defineProperty(exports, 'moduleType', {
|
|
209
169
|
enumerable: true,
|
|
210
170
|
get: function () {
|
|
@@ -246,10 +206,4 @@ Object.defineProperty(exports, 'unsupported', {
|
|
|
246
206
|
get: function () {
|
|
247
207
|
return unsupported;
|
|
248
208
|
}
|
|
249
|
-
});
|
|
250
|
-
Object.defineProperty(exports, 'withFilter', {
|
|
251
|
-
enumerable: true,
|
|
252
|
-
get: function () {
|
|
253
|
-
return withFilter;
|
|
254
|
-
}
|
|
255
209
|
});
|
|
@@ -25,56 +25,7 @@ function noop(..._args) {}
|
|
|
25
25
|
var init_misc = __esm({ "src/utils/misc.ts"() {} });
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
//#region
|
|
29
|
-
function withFilterImpl(pluginOption, filterObjectList) {
|
|
30
|
-
if (isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
|
|
31
|
-
if (pluginOption == false || pluginOption == null) return pluginOption;
|
|
32
|
-
if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
|
|
33
|
-
let plugin = pluginOption;
|
|
34
|
-
let filterObjectIndex = findMatchedFilterObject(plugin.name, filterObjectList);
|
|
35
|
-
if (filterObjectIndex === -1) return plugin;
|
|
36
|
-
let filterObject = filterObjectList[filterObjectIndex];
|
|
37
|
-
Object.keys(plugin).forEach((key) => {
|
|
38
|
-
switch (key) {
|
|
39
|
-
case "transform":
|
|
40
|
-
case "resolveId":
|
|
41
|
-
case "load":
|
|
42
|
-
if (!plugin[key]) return;
|
|
43
|
-
if (typeof plugin[key] === "object") plugin[key].filter = filterObject[key] ?? plugin[key].filter;
|
|
44
|
-
else plugin[key] = {
|
|
45
|
-
handler: plugin[key],
|
|
46
|
-
filter: filterObject[key]
|
|
47
|
-
};
|
|
48
|
-
break;
|
|
49
|
-
default: break;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return plugin;
|
|
53
|
-
}
|
|
54
|
-
function withFilter(pluginOption, filterObject) {
|
|
55
|
-
return withFilterImpl(pluginOption, arraify(filterObject));
|
|
56
|
-
}
|
|
57
|
-
function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
|
|
58
|
-
if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
|
|
59
|
-
for (let i = 0; i < overrideFilterObjectList.length; i++) for (let j = 0; j < (overrideFilterObjectList[i].pluginNamePattern ?? []).length; j++) {
|
|
60
|
-
let pattern = overrideFilterObjectList[i].pluginNamePattern[j];
|
|
61
|
-
if (typeof pattern === "string" && pattern === pluginName) return i;
|
|
62
|
-
else if (pattern instanceof RegExp && pattern.test(pluginName)) return i;
|
|
63
|
-
}
|
|
64
|
-
return -1;
|
|
65
|
-
}
|
|
66
|
-
var init_with_filter = __esm({ "src/plugin/with-filter.ts"() {
|
|
67
|
-
init_misc();
|
|
68
|
-
} });
|
|
69
|
-
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/plugin/index.ts
|
|
72
|
-
var init_plugin = __esm({ "src/plugin/index.ts"() {
|
|
73
|
-
init_with_filter();
|
|
74
|
-
} });
|
|
75
|
-
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/filter-index.ts
|
|
28
|
+
//#region ../pluginutils/dist/esm/index.js
|
|
78
29
|
function and(...args) {
|
|
79
30
|
return new And(...args);
|
|
80
31
|
}
|
|
@@ -100,8 +51,7 @@ function exclude(expr) {
|
|
|
100
51
|
return new Exclude(expr);
|
|
101
52
|
}
|
|
102
53
|
var And, Or, Not, Id, ModuleType, Code, Include, Exclude;
|
|
103
|
-
var
|
|
104
|
-
init_plugin();
|
|
54
|
+
var init_esm = __esm({ "../pluginutils/dist/esm/index.js"() {
|
|
105
55
|
And = class {
|
|
106
56
|
kind;
|
|
107
57
|
args;
|
|
@@ -171,4 +121,4 @@ var init_filter_index = __esm({ "src/filter-index.ts"() {
|
|
|
171
121
|
} });
|
|
172
122
|
|
|
173
123
|
//#endregion
|
|
174
|
-
export {
|
|
124
|
+
export { and as and$1, arraify, code as code$1, exclude as exclude$1, id as id$1, include as include$1, init_esm, init_misc, isNullish, isPromiseLike, moduleType as moduleType$1, noop, not as not$1, or as or$1, unimplemented, unreachable, unsupported };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingGlobImportPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReportPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, PreRenderedChunk as PreRenderedChunk$1, TransformOptions } from "../rolldown-binding.wasi.cjs";
|
|
1
|
+
import { BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingGlobImportPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReportPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, Bundler, ParserOptions, PreRenderedChunk, PreRenderedChunk as PreRenderedChunk$1, TransformOptions } from "../rolldown-binding.wasi.cjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
|
|
4
4
|
//#region src/log/logging.d.ts
|
|
@@ -120,7 +120,7 @@ type NullValue<T = void> = T | undefined | null | void;
|
|
|
120
120
|
type PartialNull<T> = { [P in keyof T] : T[P] | null };
|
|
121
121
|
type MakeAsync<Function_> = Function_ extends (this: infer This, ...parameters: infer Arguments) => infer Return ? (this: This, ...parameters: Arguments) => Return | Promise<Return> : never;
|
|
122
122
|
type MaybeArray<T> = T | T[];
|
|
123
|
-
type StringOrRegExp = string | RegExp;
|
|
123
|
+
type StringOrRegExp$1 = string | RegExp;
|
|
124
124
|
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/options/output-options.d.ts
|
|
@@ -226,7 +226,7 @@ interface OutputOptions {
|
|
|
226
226
|
* If `test` is a regular expression, the module whose id matches the regular expression will be captured.
|
|
227
227
|
* if `test` is empty, any module will be considered as matched.
|
|
228
228
|
*/
|
|
229
|
-
test?: StringOrRegExp
|
|
229
|
+
test?: StringOrRegExp$1
|
|
230
230
|
/**
|
|
231
231
|
* - Type: `number`
|
|
232
232
|
*
|
|
@@ -334,6 +334,7 @@ interface WatchOptions extends InputOptions {
|
|
|
334
334
|
//#region src/api/watch/watch-emitter.d.ts
|
|
335
335
|
type WatcherEvent = "close" | "event" | "restart" | "change";
|
|
336
336
|
type ChangeEvent$1 = "create" | "update" | "delete";
|
|
337
|
+
type RolldownWatchBuild = Bundler;
|
|
337
338
|
type RolldownWatcherEvent = {
|
|
338
339
|
code: "START"
|
|
339
340
|
} | {
|
|
@@ -342,11 +343,13 @@ type RolldownWatcherEvent = {
|
|
|
342
343
|
code: "BUNDLE_END"
|
|
343
344
|
duration: number
|
|
344
345
|
output: readonly string[]
|
|
346
|
+
result: RolldownWatchBuild
|
|
345
347
|
} | {
|
|
346
348
|
code: "END"
|
|
347
349
|
} | {
|
|
348
350
|
code: "ERROR"
|
|
349
351
|
error: Error
|
|
352
|
+
result: RolldownWatchBuild
|
|
350
353
|
};
|
|
351
354
|
declare class WatcherEmitter {
|
|
352
355
|
listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>;
|
|
@@ -420,62 +423,63 @@ interface NormalizedOutputOptions {
|
|
|
420
423
|
}
|
|
421
424
|
|
|
422
425
|
//#endregion
|
|
423
|
-
//#region
|
|
424
|
-
type
|
|
426
|
+
//#region ../pluginutils/dist/esm/index.d.ts
|
|
427
|
+
type StringOrRegExp = string | RegExp;
|
|
428
|
+
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
|
425
429
|
type FilterExpression = And | Or | Not | Id | ModuleType$1 | Code | Include | Exclude$1;
|
|
426
430
|
type TopLevelFilterExpression = Include | Exclude$1;
|
|
427
431
|
declare class And {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
432
|
+
kind: 'and';
|
|
433
|
+
args: FilterExpression[];
|
|
434
|
+
constructor(...args: FilterExpression[]);
|
|
431
435
|
}
|
|
432
436
|
declare class Or {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
437
|
+
kind: 'or';
|
|
438
|
+
args: FilterExpression[];
|
|
439
|
+
constructor(...args: FilterExpression[]);
|
|
436
440
|
}
|
|
437
441
|
declare class Not {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
442
|
+
kind: 'not';
|
|
443
|
+
expr: FilterExpression;
|
|
444
|
+
constructor(expr: FilterExpression);
|
|
441
445
|
}
|
|
442
446
|
declare class Id {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
447
|
+
kind: 'id';
|
|
448
|
+
pattern: StringOrRegExp;
|
|
449
|
+
constructor(pattern: StringOrRegExp);
|
|
446
450
|
}
|
|
447
451
|
declare class ModuleType$1 {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
452
|
+
kind: 'moduleType';
|
|
453
|
+
pattern: PluginModuleType;
|
|
454
|
+
constructor(pattern: PluginModuleType);
|
|
451
455
|
}
|
|
452
456
|
declare class Code {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
457
|
+
kind: 'code';
|
|
458
|
+
pattern: StringOrRegExp;
|
|
459
|
+
constructor(expr: StringOrRegExp);
|
|
456
460
|
}
|
|
457
461
|
declare class Include {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
462
|
+
kind: 'include';
|
|
463
|
+
expr: FilterExpression;
|
|
464
|
+
constructor(expr: FilterExpression);
|
|
461
465
|
}
|
|
462
466
|
declare class Exclude$1 {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
467
|
+
kind: 'exclude';
|
|
468
|
+
expr: FilterExpression;
|
|
469
|
+
constructor(expr: FilterExpression);
|
|
466
470
|
}
|
|
467
471
|
declare function and(...args: FilterExpression[]): And;
|
|
468
472
|
declare function or(...args: FilterExpression[]): Or;
|
|
469
473
|
declare function not(expr: FilterExpression): Not;
|
|
470
474
|
declare function id(pattern: StringOrRegExp): Id;
|
|
471
|
-
declare function moduleType(pattern:
|
|
475
|
+
declare function moduleType(pattern: PluginModuleType): ModuleType$1;
|
|
472
476
|
declare function code(pattern: StringOrRegExp): Code;
|
|
473
477
|
declare function include(expr: FilterExpression): Include;
|
|
474
478
|
declare function exclude(expr: FilterExpression): Exclude$1;
|
|
475
479
|
|
|
476
480
|
//#endregion
|
|
477
481
|
//#region src/plugin/hook-filter.d.ts
|
|
478
|
-
type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
|
|
482
|
+
type GeneralHookFilter<Value = StringOrRegExp$1> = MaybeArray<Value> | {
|
|
479
483
|
include?: MaybeArray<Value>
|
|
480
484
|
exclude?: MaybeArray<Value>
|
|
481
485
|
};
|
|
@@ -764,7 +768,7 @@ type OverrideFilterObject = {
|
|
|
764
768
|
transform?: HookFilterExtension<"transform">["filter"]
|
|
765
769
|
resolveId?: HookFilterExtension<"resolveId">["filter"]
|
|
766
770
|
load?: HookFilterExtension<"load">["filter"]
|
|
767
|
-
pluginNamePattern?: StringOrRegExp[]
|
|
771
|
+
pluginNamePattern?: StringOrRegExp$1[]
|
|
768
772
|
};
|
|
769
773
|
declare function withFilter<
|
|
770
774
|
A,
|
|
@@ -954,7 +958,7 @@ interface ChecksOptions {
|
|
|
954
958
|
//#region src/options/input-options.d.ts
|
|
955
959
|
type InputOption = string | string[] | Record<string, string>;
|
|
956
960
|
type OxcTransformOption = Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "jsx" | "define" | "inject" | "target">;
|
|
957
|
-
type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
|
|
961
|
+
type ExternalOption = StringOrRegExp$1 | StringOrRegExp$1[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
|
|
958
962
|
type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css">;
|
|
959
963
|
interface JsxOptions {
|
|
960
964
|
mode?: "classic" | "automatic" | "preserve";
|
|
@@ -972,8 +976,8 @@ interface WatcherOptions {
|
|
|
972
976
|
pollInterval?: number
|
|
973
977
|
compareContents?: boolean
|
|
974
978
|
};
|
|
975
|
-
include?: StringOrRegExp | StringOrRegExp[];
|
|
976
|
-
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
979
|
+
include?: StringOrRegExp$1 | StringOrRegExp$1[];
|
|
980
|
+
exclude?: StringOrRegExp$1 | StringOrRegExp$1[];
|
|
977
981
|
}
|
|
978
982
|
type MakeAbsoluteExternalsRelative = boolean | "ifRelativeSource";
|
|
979
983
|
type HmrOptions = boolean | {
|
|
@@ -1126,4 +1130,4 @@ interface InputOptions {
|
|
|
1126
1130
|
}
|
|
1127
1131
|
|
|
1128
1132
|
//#endregion
|
|
1129
|
-
export { AddonFunction,
|
|
1133
|
+
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, 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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingGlobImportPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReportPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, PreRenderedChunk as PreRenderedChunk$1, TransformOptions } from "../rolldown-binding.wasi.cjs";
|
|
1
|
+
import { BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingGlobImportPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReportPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, Bundler, ParserOptions, PreRenderedChunk, PreRenderedChunk as PreRenderedChunk$1, TransformOptions } from "../rolldown-binding.wasi.cjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
|
|
4
4
|
//#region src/log/logging.d.ts
|
|
@@ -120,7 +120,7 @@ type NullValue<T = void> = T | undefined | null | void;
|
|
|
120
120
|
type PartialNull<T> = { [P in keyof T] : T[P] | null };
|
|
121
121
|
type MakeAsync<Function_> = Function_ extends (this: infer This, ...parameters: infer Arguments) => infer Return ? (this: This, ...parameters: Arguments) => Return | Promise<Return> : never;
|
|
122
122
|
type MaybeArray<T> = T | T[];
|
|
123
|
-
type StringOrRegExp = string | RegExp;
|
|
123
|
+
type StringOrRegExp$1 = string | RegExp;
|
|
124
124
|
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/options/output-options.d.ts
|
|
@@ -226,7 +226,7 @@ interface OutputOptions {
|
|
|
226
226
|
* If `test` is a regular expression, the module whose id matches the regular expression will be captured.
|
|
227
227
|
* if `test` is empty, any module will be considered as matched.
|
|
228
228
|
*/
|
|
229
|
-
test?: StringOrRegExp
|
|
229
|
+
test?: StringOrRegExp$1
|
|
230
230
|
/**
|
|
231
231
|
* - Type: `number`
|
|
232
232
|
*
|
|
@@ -334,6 +334,7 @@ interface WatchOptions extends InputOptions {
|
|
|
334
334
|
//#region src/api/watch/watch-emitter.d.ts
|
|
335
335
|
type WatcherEvent = "close" | "event" | "restart" | "change";
|
|
336
336
|
type ChangeEvent$1 = "create" | "update" | "delete";
|
|
337
|
+
type RolldownWatchBuild = Bundler;
|
|
337
338
|
type RolldownWatcherEvent = {
|
|
338
339
|
code: "START"
|
|
339
340
|
} | {
|
|
@@ -342,11 +343,13 @@ type RolldownWatcherEvent = {
|
|
|
342
343
|
code: "BUNDLE_END"
|
|
343
344
|
duration: number
|
|
344
345
|
output: readonly string[]
|
|
346
|
+
result: RolldownWatchBuild
|
|
345
347
|
} | {
|
|
346
348
|
code: "END"
|
|
347
349
|
} | {
|
|
348
350
|
code: "ERROR"
|
|
349
351
|
error: Error
|
|
352
|
+
result: RolldownWatchBuild
|
|
350
353
|
};
|
|
351
354
|
declare class WatcherEmitter {
|
|
352
355
|
listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>;
|
|
@@ -420,62 +423,63 @@ interface NormalizedOutputOptions {
|
|
|
420
423
|
}
|
|
421
424
|
|
|
422
425
|
//#endregion
|
|
423
|
-
//#region
|
|
424
|
-
type
|
|
426
|
+
//#region ../pluginutils/dist/esm/index.d.ts
|
|
427
|
+
type StringOrRegExp = string | RegExp;
|
|
428
|
+
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
|
425
429
|
type FilterExpression = And | Or | Not | Id | ModuleType$1 | Code | Include | Exclude$1;
|
|
426
430
|
type TopLevelFilterExpression = Include | Exclude$1;
|
|
427
431
|
declare class And {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
432
|
+
kind: 'and';
|
|
433
|
+
args: FilterExpression[];
|
|
434
|
+
constructor(...args: FilterExpression[]);
|
|
431
435
|
}
|
|
432
436
|
declare class Or {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
437
|
+
kind: 'or';
|
|
438
|
+
args: FilterExpression[];
|
|
439
|
+
constructor(...args: FilterExpression[]);
|
|
436
440
|
}
|
|
437
441
|
declare class Not {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
442
|
+
kind: 'not';
|
|
443
|
+
expr: FilterExpression;
|
|
444
|
+
constructor(expr: FilterExpression);
|
|
441
445
|
}
|
|
442
446
|
declare class Id {
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
447
|
+
kind: 'id';
|
|
448
|
+
pattern: StringOrRegExp;
|
|
449
|
+
constructor(pattern: StringOrRegExp);
|
|
446
450
|
}
|
|
447
451
|
declare class ModuleType$1 {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
452
|
+
kind: 'moduleType';
|
|
453
|
+
pattern: PluginModuleType;
|
|
454
|
+
constructor(pattern: PluginModuleType);
|
|
451
455
|
}
|
|
452
456
|
declare class Code {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
457
|
+
kind: 'code';
|
|
458
|
+
pattern: StringOrRegExp;
|
|
459
|
+
constructor(expr: StringOrRegExp);
|
|
456
460
|
}
|
|
457
461
|
declare class Include {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
462
|
+
kind: 'include';
|
|
463
|
+
expr: FilterExpression;
|
|
464
|
+
constructor(expr: FilterExpression);
|
|
461
465
|
}
|
|
462
466
|
declare class Exclude$1 {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
467
|
+
kind: 'exclude';
|
|
468
|
+
expr: FilterExpression;
|
|
469
|
+
constructor(expr: FilterExpression);
|
|
466
470
|
}
|
|
467
471
|
declare function and(...args: FilterExpression[]): And;
|
|
468
472
|
declare function or(...args: FilterExpression[]): Or;
|
|
469
473
|
declare function not(expr: FilterExpression): Not;
|
|
470
474
|
declare function id(pattern: StringOrRegExp): Id;
|
|
471
|
-
declare function moduleType(pattern:
|
|
475
|
+
declare function moduleType(pattern: PluginModuleType): ModuleType$1;
|
|
472
476
|
declare function code(pattern: StringOrRegExp): Code;
|
|
473
477
|
declare function include(expr: FilterExpression): Include;
|
|
474
478
|
declare function exclude(expr: FilterExpression): Exclude$1;
|
|
475
479
|
|
|
476
480
|
//#endregion
|
|
477
481
|
//#region src/plugin/hook-filter.d.ts
|
|
478
|
-
type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
|
|
482
|
+
type GeneralHookFilter<Value = StringOrRegExp$1> = MaybeArray<Value> | {
|
|
479
483
|
include?: MaybeArray<Value>
|
|
480
484
|
exclude?: MaybeArray<Value>
|
|
481
485
|
};
|
|
@@ -764,7 +768,7 @@ type OverrideFilterObject = {
|
|
|
764
768
|
transform?: HookFilterExtension<"transform">["filter"]
|
|
765
769
|
resolveId?: HookFilterExtension<"resolveId">["filter"]
|
|
766
770
|
load?: HookFilterExtension<"load">["filter"]
|
|
767
|
-
pluginNamePattern?: StringOrRegExp[]
|
|
771
|
+
pluginNamePattern?: StringOrRegExp$1[]
|
|
768
772
|
};
|
|
769
773
|
declare function withFilter<
|
|
770
774
|
A,
|
|
@@ -954,7 +958,7 @@ interface ChecksOptions {
|
|
|
954
958
|
//#region src/options/input-options.d.ts
|
|
955
959
|
type InputOption = string | string[] | Record<string, string>;
|
|
956
960
|
type OxcTransformOption = Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "jsx" | "define" | "inject" | "target">;
|
|
957
|
-
type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
|
|
961
|
+
type ExternalOption = StringOrRegExp$1 | StringOrRegExp$1[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
|
|
958
962
|
type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css">;
|
|
959
963
|
interface JsxOptions {
|
|
960
964
|
mode?: "classic" | "automatic" | "preserve";
|
|
@@ -972,8 +976,8 @@ interface WatcherOptions {
|
|
|
972
976
|
pollInterval?: number
|
|
973
977
|
compareContents?: boolean
|
|
974
978
|
};
|
|
975
|
-
include?: StringOrRegExp | StringOrRegExp[];
|
|
976
|
-
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
979
|
+
include?: StringOrRegExp$1 | StringOrRegExp$1[];
|
|
980
|
+
exclude?: StringOrRegExp$1 | StringOrRegExp$1[];
|
|
977
981
|
}
|
|
978
982
|
type MakeAbsoluteExternalsRelative = boolean | "ifRelativeSource";
|
|
979
983
|
type HmrOptions = boolean | {
|
|
@@ -1126,4 +1130,4 @@ interface InputOptions {
|
|
|
1126
1130
|
}
|
|
1127
1131
|
|
|
1128
1132
|
//#endregion
|
|
1129
|
-
export { AddonFunction,
|
|
1133
|
+
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, 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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
|
-
const
|
|
3
|
+
const require_esm = require('./esm-Bpw6hef2.cjs');
|
|
4
4
|
const require_parse_ast_index = require('./parse-ast-index-C4XbfZ6x.cjs');
|
|
5
5
|
const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
|
|
6
6
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
@@ -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.e270f24";
|
|
13
13
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
@@ -114,7 +114,7 @@ const logLevelPriority = {
|
|
|
114
114
|
//#region src/log/log-handler.ts
|
|
115
115
|
const normalizeLog = (log) => typeof log === "string" ? { message: log } : typeof log === "function" ? normalizeLog(log()) : log;
|
|
116
116
|
function getLogHandler(level, code$1, logger, pluginName, logLevel) {
|
|
117
|
-
if (logLevelPriority[level] < logLevelPriority[logLevel]) return
|
|
117
|
+
if (logLevelPriority[level] < logLevelPriority[logLevel]) return require_esm.noop;
|
|
118
118
|
return (log, pos) => {
|
|
119
119
|
if (pos != null) logger(LOG_LEVEL_WARN, require_parse_ast_index.logInvalidLogPosition(pluginName));
|
|
120
120
|
log = normalizeLog(log);
|
|
@@ -217,7 +217,7 @@ function normalizeHook(hook) {
|
|
|
217
217
|
meta: { order }
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
|
-
|
|
220
|
+
require_esm.unreachable("Invalid hook type");
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
//#endregion
|
|
@@ -2183,7 +2183,7 @@ function joinNewLine(s1, s2) {
|
|
|
2183
2183
|
function transformModuleInfo(info, option) {
|
|
2184
2184
|
return {
|
|
2185
2185
|
get ast() {
|
|
2186
|
-
return
|
|
2186
|
+
return require_esm.unsupported("ModuleInfo#ast");
|
|
2187
2187
|
},
|
|
2188
2188
|
get code() {
|
|
2189
2189
|
return info.code;
|
|
@@ -2266,15 +2266,15 @@ function t(...n) {
|
|
|
2266
2266
|
//#endregion
|
|
2267
2267
|
//#region src/plugin/bindingify-hook-filter.ts
|
|
2268
2268
|
function generalHookFilterMatcherToFilterExprs(matcher, stringKind) {
|
|
2269
|
-
if (typeof matcher === "string" || matcher instanceof RegExp) return [
|
|
2270
|
-
if (Array.isArray(matcher)) return matcher.map((m) =>
|
|
2269
|
+
if (typeof matcher === "string" || matcher instanceof RegExp) return [require_esm.include(generateAtomMatcher(stringKind, matcher))];
|
|
2270
|
+
if (Array.isArray(matcher)) return matcher.map((m) => require_esm.include(generateAtomMatcher(stringKind, m)));
|
|
2271
2271
|
let ret = [];
|
|
2272
|
-
if (matcher.exclude) ret.push(...
|
|
2273
|
-
if (matcher.include) ret.push(...
|
|
2272
|
+
if (matcher.exclude) ret.push(...require_esm.arraify(matcher.exclude).map((m) => require_esm.exclude(generateAtomMatcher(stringKind, m))));
|
|
2273
|
+
if (matcher.include) ret.push(...require_esm.arraify(matcher.include).map((m) => require_esm.include(generateAtomMatcher(stringKind, m))));
|
|
2274
2274
|
return ret;
|
|
2275
2275
|
}
|
|
2276
2276
|
function generateAtomMatcher(kind, matcher) {
|
|
2277
|
-
return kind === "code" ?
|
|
2277
|
+
return kind === "code" ? require_esm.code(matcher) : require_esm.id(matcher);
|
|
2278
2278
|
}
|
|
2279
2279
|
function transformFilterMatcherToFilterExprs(filterOption) {
|
|
2280
2280
|
if (!filterOption) return void 0;
|
|
@@ -2292,11 +2292,11 @@ function transformFilterMatcherToFilterExprs(filterOption) {
|
|
|
2292
2292
|
let andExprList = [];
|
|
2293
2293
|
if (moduleType$1) {
|
|
2294
2294
|
let moduleTypes = Array.isArray(moduleType$1) ? moduleType$1 : moduleType$1.include ?? [];
|
|
2295
|
-
andExprList.push(
|
|
2295
|
+
andExprList.push(require_esm.or(...moduleTypes.map((m) => require_esm.moduleType(m))));
|
|
2296
2296
|
}
|
|
2297
|
-
if (idIncludes.length) andExprList.push(
|
|
2298
|
-
if (codeIncludes.length) andExprList.push(
|
|
2299
|
-
if (andExprList.length) ret.push(
|
|
2297
|
+
if (idIncludes.length) andExprList.push(require_esm.or(...idIncludes.map((item) => item.expr)));
|
|
2298
|
+
if (codeIncludes.length) andExprList.push(require_esm.or(...codeIncludes.map((item) => item.expr)));
|
|
2299
|
+
if (andExprList.length) ret.push(require_esm.include(require_esm.and(...andExprList)));
|
|
2300
2300
|
return ret;
|
|
2301
2301
|
}
|
|
2302
2302
|
function bindingifyGeneralHookFilter(stringKind, pattern) {
|
|
@@ -2471,12 +2471,12 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
2471
2471
|
const info = this.data.getModuleOption(res.id) || {};
|
|
2472
2472
|
return {
|
|
2473
2473
|
...res,
|
|
2474
|
-
external: res.external === "relative" ?
|
|
2474
|
+
external: res.external === "relative" ? require_esm.unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
|
|
2475
2475
|
...info
|
|
2476
2476
|
};
|
|
2477
2477
|
}
|
|
2478
2478
|
emitFile = (file) => {
|
|
2479
|
-
if (file.type === "prebuilt-chunk") return
|
|
2479
|
+
if (file.type === "prebuilt-chunk") return require_esm.unimplemented("PluginContext.emitFile with type prebuilt-chunk");
|
|
2480
2480
|
if (file.type === "chunk") return this.context.emitChunk(file);
|
|
2481
2481
|
const fnSanitizedFileName = file.fileName || typeof this.outputOptions.sanitizeFileName !== "function" ? void 0 : this.outputOptions.sanitizeFileName(file.name || "asset");
|
|
2482
2482
|
const filename = file.fileName ? void 0 : this.getAssetFileNames(file);
|
|
@@ -2821,7 +2821,7 @@ function bindingifyFormat(format) {
|
|
|
2821
2821
|
case "iife": return "iife";
|
|
2822
2822
|
case "umd": return "umd";
|
|
2823
2823
|
case "experimental-app": return "app";
|
|
2824
|
-
default:
|
|
2824
|
+
default: require_esm.unimplemented(`output.format: ${format}`);
|
|
2825
2825
|
}
|
|
2826
2826
|
}
|
|
2827
2827
|
function bindingifySourcemap(sourcemap) {
|
|
@@ -3615,7 +3615,7 @@ function bindingifyExternal(external) {
|
|
|
3615
3615
|
if (id$1.startsWith("\0")) return false;
|
|
3616
3616
|
return external(id$1, importer, isResolved) ?? false;
|
|
3617
3617
|
};
|
|
3618
|
-
const externalArr =
|
|
3618
|
+
const externalArr = require_esm.arraify(external);
|
|
3619
3619
|
return (id$1, _importer, _isResolved) => {
|
|
3620
3620
|
return externalArr.some((pat) => {
|
|
3621
3621
|
if (pat instanceof RegExp) return pat.test(id$1);
|
|
@@ -3630,7 +3630,7 @@ function bindingifyResolve(resolve) {
|
|
|
3630
3630
|
return {
|
|
3631
3631
|
alias: alias ? Object.entries(alias).map(([name, replacement]) => ({
|
|
3632
3632
|
find: name,
|
|
3633
|
-
replacements:
|
|
3633
|
+
replacements: require_esm.arraify(replacement)
|
|
3634
3634
|
})) : void 0,
|
|
3635
3635
|
extensionAlias: extensionAlias ? Object.entries(extensionAlias).map(([name, value]) => ({
|
|
3636
3636
|
target: name,
|
|
@@ -3877,7 +3877,7 @@ function createComposedPlugin(plugins) {
|
|
|
3877
3877
|
if (symbolForCallerThatSkipSelf === handlerSymbol) continue;
|
|
3878
3878
|
const { handler: handlerFn } = normalizeHook(handler);
|
|
3879
3879
|
const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), source, importer, rawHookResolveIdOptions);
|
|
3880
|
-
if (!
|
|
3880
|
+
if (!require_esm.isNullish(result)) return result;
|
|
3881
3881
|
}
|
|
3882
3882
|
};
|
|
3883
3883
|
}
|
|
@@ -3903,7 +3903,7 @@ function createComposedPlugin(plugins) {
|
|
|
3903
3903
|
for (const [handler, plugin] of batchedHandlers) {
|
|
3904
3904
|
const { handler: handlerFn } = normalizeHook(handler);
|
|
3905
3905
|
const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), id$1);
|
|
3906
|
-
if (!
|
|
3906
|
+
if (!require_esm.isNullish(result)) return result;
|
|
3907
3907
|
}
|
|
3908
3908
|
};
|
|
3909
3909
|
}
|
|
@@ -3925,7 +3925,7 @@ function createComposedPlugin(plugins) {
|
|
|
3925
3925
|
throw new Error(`The getCombinedSourcemap is not implement in transform hook at composedJsPlugins`);
|
|
3926
3926
|
};
|
|
3927
3927
|
const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code$1, id$1, moduleType$1);
|
|
3928
|
-
if (!
|
|
3928
|
+
if (!require_esm.isNullish(result)) {
|
|
3929
3929
|
if (typeof result === "string") updateOutput(result);
|
|
3930
3930
|
else if (result.code) updateOutput(result.code, result.moduleSideEffects);
|
|
3931
3931
|
}
|
|
@@ -3957,7 +3957,7 @@ function createComposedPlugin(plugins) {
|
|
|
3957
3957
|
for (const [handler, plugin] of batchedHandlers) {
|
|
3958
3958
|
const { handler: handlerFn } = normalizeHook(handler);
|
|
3959
3959
|
const result = await handlerFn.call(applyFixedPluginResolveFn(this, plugin), code$1, chunk, options, meta);
|
|
3960
|
-
if (!
|
|
3960
|
+
if (!require_esm.isNullish(result)) return result;
|
|
3961
3961
|
}
|
|
3962
3962
|
};
|
|
3963
3963
|
}
|
|
@@ -4271,18 +4271,20 @@ var WatcherEmitter = class {
|
|
|
4271
4271
|
const code$1 = event.bundleEventKind();
|
|
4272
4272
|
switch (code$1) {
|
|
4273
4273
|
case "BUNDLE_END":
|
|
4274
|
-
const { duration, output } = event.bundleEndData();
|
|
4274
|
+
const { duration, output, result } = event.bundleEndData();
|
|
4275
4275
|
await listener({
|
|
4276
4276
|
code: "BUNDLE_END",
|
|
4277
4277
|
duration,
|
|
4278
|
-
output: [output]
|
|
4278
|
+
output: [output],
|
|
4279
|
+
result
|
|
4279
4280
|
});
|
|
4280
4281
|
break;
|
|
4281
4282
|
case "ERROR":
|
|
4282
|
-
const
|
|
4283
|
+
const data = event.bundleErrorData();
|
|
4283
4284
|
await listener({
|
|
4284
4285
|
code: "ERROR",
|
|
4285
|
-
error: normalizeErrors(
|
|
4286
|
+
error: normalizeErrors(data.error),
|
|
4287
|
+
result: data.result
|
|
4286
4288
|
});
|
|
4287
4289
|
break;
|
|
4288
4290
|
default:
|
|
@@ -4335,8 +4337,8 @@ var Watcher = class {
|
|
|
4335
4337
|
}
|
|
4336
4338
|
};
|
|
4337
4339
|
async function createWatcher(emitter, input) {
|
|
4338
|
-
const options =
|
|
4339
|
-
const bundlerOptions = await Promise.all(options.map((option) =>
|
|
4340
|
+
const options = require_esm.arraify(input);
|
|
4341
|
+
const bundlerOptions = await Promise.all(options.map((option) => require_esm.arraify(option.output || {}).map(async (output) => {
|
|
4340
4342
|
const inputOptions = await PluginDriver.callOptionsHook(option, true);
|
|
4341
4343
|
return createBundlerOptions(inputOptions, output, true);
|
|
4342
4344
|
})).flat());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __esm } from "./chunk-DSsiIF1Z.mjs";
|
|
2
|
-
import { and, arraify, code, exclude, id, include,
|
|
2
|
+
import { and$1 as and, arraify, code$1 as code, exclude$1 as exclude, id$1 as id, include$1 as include, init_esm, init_misc, isNullish, moduleType$1 as moduleType, noop, or$1 as or, unimplemented, unreachable, unsupported } from "./esm-hYMC2_r0.mjs";
|
|
3
3
|
import { augmentCodeLocation, error, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-D_ZB9M77.mjs";
|
|
4
4
|
import { BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -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.e270f24";
|
|
12
12
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
@@ -3623,8 +3623,8 @@ function bindingifyRenderChunkFilter(filterOption) {
|
|
|
3623
3623
|
return filterOption.code ? bindingifyGeneralHookFilter("code", filterOption.code) : void 0;
|
|
3624
3624
|
}
|
|
3625
3625
|
var init_bindingify_hook_filter = __esm({ "src/plugin/bindingify-hook-filter.ts"() {
|
|
3626
|
+
init_esm();
|
|
3626
3627
|
init_dist();
|
|
3627
|
-
init_filter_index();
|
|
3628
3628
|
init_misc();
|
|
3629
3629
|
} });
|
|
3630
3630
|
|
|
@@ -5645,18 +5645,20 @@ var init_watch_emitter = __esm({ "src/api/watch/watch-emitter.ts"() {
|
|
|
5645
5645
|
const code$1 = event.bundleEventKind();
|
|
5646
5646
|
switch (code$1) {
|
|
5647
5647
|
case "BUNDLE_END":
|
|
5648
|
-
const { duration, output } = event.bundleEndData();
|
|
5648
|
+
const { duration, output, result } = event.bundleEndData();
|
|
5649
5649
|
await listener({
|
|
5650
5650
|
code: "BUNDLE_END",
|
|
5651
5651
|
duration,
|
|
5652
|
-
output: [output]
|
|
5652
|
+
output: [output],
|
|
5653
|
+
result
|
|
5653
5654
|
});
|
|
5654
5655
|
break;
|
|
5655
5656
|
case "ERROR":
|
|
5656
|
-
const
|
|
5657
|
+
const data = event.bundleErrorData();
|
|
5657
5658
|
await listener({
|
|
5658
5659
|
code: "ERROR",
|
|
5659
|
-
error: normalizeErrors(
|
|
5660
|
+
error: normalizeErrors(data.error),
|
|
5661
|
+
result: data.result
|
|
5660
5662
|
});
|
|
5661
5663
|
break;
|
|
5662
5664
|
default:
|
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.e270f24",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"type": "module",
|