@rolldown/browser 1.0.0-beta.8-commit.e270f24 → 1.0.0-beta.8-commit.56abf23
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 +8 -8
- package/dist/cli.mjs +5 -5
- package/dist/experimental-index.browser.mjs +76 -0
- 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 +11 -11
- package/dist/filter-index.d.cts +1 -1
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +1 -1
- package/dist/index.browser.mjs +3 -0
- 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.wasm32-wasi.wasm +0 -0
- package/dist/shared/{esm-Bpw6hef2.cjs → composable-filters-Dbe8wGLg.cjs} +1 -1
- package/dist/shared/{esm-hYMC2_r0.mjs → esm-CW9DP8HJ.mjs} +13 -2
- package/dist/shared/{input-options.d-B9wi4n3f.d.mts → input-options.d-BzRVeVzs.d.mts} +1 -1
- package/dist/shared/{input-options.d-DsS7pFhE.d.cts → input-options.d-b875W0uo.d.cts} +1 -1
- package/dist/shared/{src-Bge47TAa.cjs → src-CTpSZALv.cjs} +25 -25
- package/dist/shared/{src-DEcj849i.mjs → src-QAqIvxUw.mjs} +2 -2
- package/dist/{browser.mjs → src-xSRj8hhl.js} +70 -4
- package/package.json +4 -3
package/dist/cli.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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-CTpSZALv.cjs');
|
|
3
|
+
const require_composable_filters = require('./shared/composable-filters-Dbe8wGLg.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"));
|
|
7
|
+
const node_url = require_chunk.__toESM(require("node:url"));
|
|
7
8
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
8
9
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
9
10
|
const node_tty = require_chunk.__toESM(require("node:tty"));
|
|
10
11
|
const node_perf_hooks = require_chunk.__toESM(require("node:perf_hooks"));
|
|
11
12
|
const node_fs = require_chunk.__toESM(require("node:fs"));
|
|
12
13
|
const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
|
|
13
|
-
const node_url = require_chunk.__toESM(require("node:url"));
|
|
14
14
|
|
|
15
15
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
16
16
|
const LogLevels = {
|
|
@@ -1618,10 +1618,10 @@ var require_usingCtx = require_chunk.__commonJS({ "../../node_modules/.pnpm/@oxc
|
|
|
1618
1618
|
}
|
|
1619
1619
|
module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1620
1620
|
} });
|
|
1621
|
-
var import_usingCtx = require_chunk.__toESM(require_usingCtx());
|
|
1622
1621
|
|
|
1623
1622
|
//#endregion
|
|
1624
1623
|
//#region src/cli/commands/bundle.ts
|
|
1624
|
+
var import_usingCtx = require_chunk.__toESM(require_usingCtx());
|
|
1625
1625
|
async function bundleWithConfig(configPath, cliOptions) {
|
|
1626
1626
|
if (cliOptions.watch) {
|
|
1627
1627
|
process.env.ROLLUP_WATCH = "true";
|
|
@@ -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_composable_filters.arraify(config).map((option) => {
|
|
1668
1668
|
return {
|
|
1669
1669
|
...option,
|
|
1670
1670
|
...cliOptions.input,
|
|
1671
|
-
output:
|
|
1671
|
+
output: require_composable_filters.arraify(option.output || {}).map((output) => {
|
|
1672
1672
|
return {
|
|
1673
1673
|
...output,
|
|
1674
1674
|
...cliOptions.output
|
|
@@ -1709,9 +1709,9 @@ async function watchInner(config, cliOptions) {
|
|
|
1709
1709
|
async function bundleInner(config, cliOptions) {
|
|
1710
1710
|
const startTime = node_perf_hooks.performance.now();
|
|
1711
1711
|
const result = [];
|
|
1712
|
-
const configList =
|
|
1712
|
+
const configList = require_composable_filters.arraify(config);
|
|
1713
1713
|
for (const config$1 of configList) {
|
|
1714
|
-
const outputList =
|
|
1714
|
+
const outputList = require_composable_filters.arraify(config$1.output || {});
|
|
1715
1715
|
const build = await require_src.rolldown({
|
|
1716
1716
|
...config$1,
|
|
1717
1717
|
...cliOptions.input
|
package/dist/cli.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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/esm-
|
|
2
|
+
import { description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-QAqIvxUw.mjs";
|
|
3
|
+
import { arraify, init_misc } from "./shared/esm-CW9DP8HJ.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";
|
|
7
|
+
import { pathToFileURL } from "node:url";
|
|
7
8
|
import process$1, { cwd } from "node:process";
|
|
8
9
|
import { formatWithOptions, parseArgs } from "node:util";
|
|
9
10
|
import * as tty from "node:tty";
|
|
10
11
|
import { performance } from "node:perf_hooks";
|
|
11
12
|
import fs from "node:fs";
|
|
12
13
|
import { readdir } from "node:fs/promises";
|
|
13
|
-
import { pathToFileURL } from "node:url";
|
|
14
14
|
|
|
15
15
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
16
16
|
function isPlainObject$1(value) {
|
|
@@ -1623,7 +1623,6 @@ var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runti
|
|
|
1623
1623
|
}
|
|
1624
1624
|
module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1625
1625
|
} });
|
|
1626
|
-
var import_usingCtx = __toESM(require_usingCtx());
|
|
1627
1626
|
|
|
1628
1627
|
//#endregion
|
|
1629
1628
|
//#region src/cli/commands/bundle.ts
|
|
@@ -1789,7 +1788,7 @@ function relativeId(id) {
|
|
|
1789
1788
|
if (!path.isAbsolute(id)) return id;
|
|
1790
1789
|
return path.relative(path.resolve(), id);
|
|
1791
1790
|
}
|
|
1792
|
-
var numberFormatter, CHUNK_GROUPS;
|
|
1791
|
+
var import_usingCtx, numberFormatter, CHUNK_GROUPS;
|
|
1793
1792
|
var init_bundle = __esm({ "src/cli/commands/bundle.ts"() {
|
|
1794
1793
|
init_mjs();
|
|
1795
1794
|
init_rolldown();
|
|
@@ -1797,6 +1796,7 @@ var init_bundle = __esm({ "src/cli/commands/bundle.ts"() {
|
|
|
1797
1796
|
init_misc();
|
|
1798
1797
|
init_load_config();
|
|
1799
1798
|
init_logger();
|
|
1799
|
+
import_usingCtx = __toESM(require_usingCtx());
|
|
1800
1800
|
numberFormatter = new Intl.NumberFormat("en", {
|
|
1801
1801
|
maximumFractionDigits: 2,
|
|
1802
1802
|
minimumFractionDigits: 2
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./src-xSRj8hhl.js";
|
|
2
|
+
import { isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
|
|
3
|
+
|
|
4
|
+
//#region src/api/experimental.ts
|
|
5
|
+
/**
|
|
6
|
+
* This is an experimental API. It's behavior may change in the future.
|
|
7
|
+
*
|
|
8
|
+
* Calling this API will only execute the scan stage of rolldown.
|
|
9
|
+
*/
|
|
10
|
+
const experimental_scan = async (input) => {
|
|
11
|
+
const { bundler, stopWorkers } = await createBundler(input, {});
|
|
12
|
+
const output = await bundler.scan();
|
|
13
|
+
handleOutputErrors(output);
|
|
14
|
+
await stopWorkers?.();
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/plugin/parallel-plugin.ts
|
|
19
|
+
function defineParallelPlugin(pluginPath) {
|
|
20
|
+
throw new Error("`defineParallelPlugin` is not supported in browser build");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/builtin-plugin/alias-plugin.ts
|
|
25
|
+
function aliasPlugin(config) {
|
|
26
|
+
return new BuiltinPlugin("builtin:alias", config);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/builtin-plugin/replace-plugin.ts
|
|
31
|
+
/**
|
|
32
|
+
* Replaces targeted strings in files while bundling.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Basic usage
|
|
36
|
+
* ```js
|
|
37
|
+
* replacePlugin({
|
|
38
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
39
|
+
* __buildDate__: () => JSON.stringify(new Date()),
|
|
40
|
+
* __buildVersion: 15
|
|
41
|
+
* })
|
|
42
|
+
* ```
|
|
43
|
+
* @example
|
|
44
|
+
* // With options
|
|
45
|
+
* ```js
|
|
46
|
+
* replacePlugin({
|
|
47
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
48
|
+
* __buildDate__: () => JSON.stringify(new Date()),
|
|
49
|
+
* __buildVersion: 15
|
|
50
|
+
* }, {
|
|
51
|
+
* preventAssignment: false,
|
|
52
|
+
* })
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
function replacePlugin(values = {}, options = {}) {
|
|
56
|
+
return new BuiltinPlugin("builtin:replace", {
|
|
57
|
+
...options,
|
|
58
|
+
values
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/builtin-plugin/transform-plugin.ts
|
|
64
|
+
function transformPlugin(config) {
|
|
65
|
+
if (config) config = {
|
|
66
|
+
...config,
|
|
67
|
+
include: normalizedStringOrRegex(config.include),
|
|
68
|
+
exclude: normalizedStringOrRegex(config.exclude),
|
|
69
|
+
jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
|
|
70
|
+
jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude)
|
|
71
|
+
};
|
|
72
|
+
return new BuiltinPlugin("builtin:transform", config);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins as composePlugins, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, replacePlugin, reportPlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin };
|
|
@@ -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-CTpSZALv.cjs');
|
|
4
|
+
require('./shared/composable-filters-Dbe8wGLg.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-b875W0uo.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-BzRVeVzs.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/esm-
|
|
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-QAqIvxUw.mjs";
|
|
2
|
+
import "./shared/esm-CW9DP8HJ.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,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
2
|
+
const require_composable_filters = require('./shared/composable-filters-Dbe8wGLg.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/with-filter.ts
|
|
5
5
|
function withFilterImpl(pluginOption, filterObjectList) {
|
|
6
|
-
if (
|
|
6
|
+
if (require_composable_filters.isPromiseLike(pluginOption)) return pluginOption.then((p) => withFilter(p, filterObjectList));
|
|
7
7
|
if (pluginOption == false || pluginOption == null) return pluginOption;
|
|
8
8
|
if (Array.isArray(pluginOption)) return pluginOption.map((p) => withFilter(p, filterObjectList));
|
|
9
9
|
let plugin = pluginOption;
|
|
@@ -28,7 +28,7 @@ function withFilterImpl(pluginOption, filterObjectList) {
|
|
|
28
28
|
return plugin;
|
|
29
29
|
}
|
|
30
30
|
function withFilter(pluginOption, filterObject) {
|
|
31
|
-
return withFilterImpl(pluginOption,
|
|
31
|
+
return withFilterImpl(pluginOption, require_composable_filters.arraify(filterObject));
|
|
32
32
|
}
|
|
33
33
|
function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
|
|
34
34
|
if (overrideFilterObjectList.length === 1 && overrideFilterObjectList[0].pluginNamePattern === void 0) return 0;
|
|
@@ -41,12 +41,12 @@ function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
//#endregion
|
|
44
|
-
exports.and =
|
|
45
|
-
exports.code =
|
|
46
|
-
exports.exclude =
|
|
47
|
-
exports.id =
|
|
48
|
-
exports.include =
|
|
49
|
-
exports.moduleType =
|
|
50
|
-
exports.not =
|
|
51
|
-
exports.or =
|
|
44
|
+
exports.and = require_composable_filters.and
|
|
45
|
+
exports.code = require_composable_filters.code
|
|
46
|
+
exports.exclude = require_composable_filters.exclude
|
|
47
|
+
exports.id = require_composable_filters.id
|
|
48
|
+
exports.include = require_composable_filters.include
|
|
49
|
+
exports.moduleType = require_composable_filters.moduleType
|
|
50
|
+
exports.not = require_composable_filters.not
|
|
51
|
+
exports.or = require_composable_filters.or
|
|
52
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/input-options.d-
|
|
1
|
+
import { and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/input-options.d-b875W0uo.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/input-options.d-
|
|
1
|
+
import { and, code, exclude, id, include, moduleType, not, or, withFilter } from "./shared/input-options.d-BzRVeVzs.mjs";
|
|
2
2
|
|
|
3
3
|
export { and, code, exclude, id, include, moduleType, not, or, withFilter };
|
package/dist/filter-index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-CW9DP8HJ.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/with-filter.ts
|
|
4
4
|
init_misc();
|
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-CTpSZALv.cjs');
|
|
2
|
+
require('./shared/composable-filters-Dbe8wGLg.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-b875W0uo.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-BzRVeVzs.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/esm-
|
|
1
|
+
import { VERSION, build, defineConfig, init_src, rolldown, watch } from "./shared/src-QAqIvxUw.mjs";
|
|
2
|
+
import "./shared/esm-CW9DP8HJ.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-CTpSZALv.cjs');
|
|
3
|
+
require('./shared/composable-filters-Dbe8wGLg.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/esm-
|
|
2
|
+
import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-QAqIvxUw.mjs";
|
|
3
|
+
import "./shared/esm-CW9DP8HJ.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";
|
|
Binary file
|
|
@@ -25,7 +25,7 @@ function noop(..._args) {}
|
|
|
25
25
|
var init_misc = __esm({ "src/utils/misc.ts"() {} });
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
|
-
//#region ../pluginutils/dist/esm/
|
|
28
|
+
//#region ../pluginutils/dist/esm/composable-filters.js
|
|
29
29
|
function and(...args) {
|
|
30
30
|
return new And(...args);
|
|
31
31
|
}
|
|
@@ -51,7 +51,7 @@ function exclude(expr) {
|
|
|
51
51
|
return new Exclude(expr);
|
|
52
52
|
}
|
|
53
53
|
var And, Or, Not, Id, ModuleType, Code, Include, Exclude;
|
|
54
|
-
var
|
|
54
|
+
var init_composable_filters = __esm({ "../pluginutils/dist/esm/composable-filters.js"() {
|
|
55
55
|
And = class {
|
|
56
56
|
kind;
|
|
57
57
|
args;
|
|
@@ -120,5 +120,16 @@ var init_esm = __esm({ "../pluginutils/dist/esm/index.js"() {
|
|
|
120
120
|
};
|
|
121
121
|
} });
|
|
122
122
|
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region ../pluginutils/dist/esm/simple-filters.js
|
|
125
|
+
var init_simple_filters = __esm({ "../pluginutils/dist/esm/simple-filters.js"() {} });
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region ../pluginutils/dist/esm/index.js
|
|
129
|
+
var init_esm = __esm({ "../pluginutils/dist/esm/index.js"() {
|
|
130
|
+
init_composable_filters();
|
|
131
|
+
init_simple_filters();
|
|
132
|
+
} });
|
|
133
|
+
|
|
123
134
|
//#endregion
|
|
124
135
|
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 };
|
|
@@ -423,7 +423,7 @@ interface NormalizedOutputOptions {
|
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
//#endregion
|
|
426
|
-
//#region ../pluginutils/dist/esm/
|
|
426
|
+
//#region ../pluginutils/dist/esm/composable-filters.d.ts
|
|
427
427
|
type StringOrRegExp = string | RegExp;
|
|
428
428
|
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
|
429
429
|
type FilterExpression = And | Or | Not | Id | ModuleType$1 | Code | Include | Exclude$1;
|
|
@@ -423,7 +423,7 @@ interface NormalizedOutputOptions {
|
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
//#endregion
|
|
426
|
-
//#region ../pluginutils/dist/esm/
|
|
426
|
+
//#region ../pluginutils/dist/esm/composable-filters.d.ts
|
|
427
427
|
type StringOrRegExp = string | RegExp;
|
|
428
428
|
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
|
429
429
|
type FilterExpression = And | Or | Not | Id | ModuleType$1 | Code | Include | Exclude$1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-qZFfknuJ.cjs');
|
|
3
|
-
const
|
|
3
|
+
const require_composable_filters = require('./composable-filters-Dbe8wGLg.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.56abf23";
|
|
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_composable_filters.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_composable_filters.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_composable_filters.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_composable_filters.include(generateAtomMatcher(stringKind, matcher))];
|
|
2270
|
+
if (Array.isArray(matcher)) return matcher.map((m) => require_composable_filters.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_composable_filters.arraify(matcher.exclude).map((m) => require_composable_filters.exclude(generateAtomMatcher(stringKind, m))));
|
|
2273
|
+
if (matcher.include) ret.push(...require_composable_filters.arraify(matcher.include).map((m) => require_composable_filters.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_composable_filters.code(matcher) : require_composable_filters.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_composable_filters.or(...moduleTypes.map((m) => require_composable_filters.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_composable_filters.or(...idIncludes.map((item) => item.expr)));
|
|
2298
|
+
if (codeIncludes.length) andExprList.push(require_composable_filters.or(...codeIncludes.map((item) => item.expr)));
|
|
2299
|
+
if (andExprList.length) ret.push(require_composable_filters.include(require_composable_filters.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_composable_filters.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_composable_filters.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_composable_filters.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_composable_filters.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_composable_filters.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_composable_filters.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_composable_filters.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_composable_filters.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_composable_filters.isNullish(result)) return result;
|
|
3961
3961
|
}
|
|
3962
3962
|
};
|
|
3963
3963
|
}
|
|
@@ -4337,8 +4337,8 @@ var Watcher = class {
|
|
|
4337
4337
|
}
|
|
4338
4338
|
};
|
|
4339
4339
|
async function createWatcher(emitter, input) {
|
|
4340
|
-
const options =
|
|
4341
|
-
const bundlerOptions = await Promise.all(options.map((option) =>
|
|
4340
|
+
const options = require_composable_filters.arraify(input);
|
|
4341
|
+
const bundlerOptions = await Promise.all(options.map((option) => require_composable_filters.arraify(option.output || {}).map(async (output) => {
|
|
4342
4342
|
const inputOptions = await PluginDriver.callOptionsHook(option, true);
|
|
4343
4343
|
return createBundlerOptions(inputOptions, output, true);
|
|
4344
4344
|
})).flat());
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __esm } from "./chunk-DSsiIF1Z.mjs";
|
|
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-
|
|
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-CW9DP8HJ.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.56abf23";
|
|
12
12
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { BindingHookSideEffects, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
1
|
+
import { BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
2
2
|
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.56abf23";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/builtin-plugin/utils.ts
|
|
10
|
+
function makeBuiltinPluginCallable(plugin) {
|
|
11
|
+
let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
12
|
+
const wrappedPlugin = plugin;
|
|
13
|
+
for (const key in callablePlugin) wrappedPlugin[key] = function(...args$1) {
|
|
14
|
+
return callablePlugin[key](...args$1);
|
|
15
|
+
};
|
|
16
|
+
return wrappedPlugin;
|
|
17
|
+
}
|
|
10
18
|
function bindingifyBuiltInPlugin(plugin) {
|
|
11
19
|
return {
|
|
12
20
|
__name: plugin.name,
|
|
@@ -22,6 +30,64 @@ var BuiltinPlugin = class {
|
|
|
22
30
|
this._options = _options;
|
|
23
31
|
}
|
|
24
32
|
};
|
|
33
|
+
function modulePreloadPolyfillPlugin(config) {
|
|
34
|
+
return new BuiltinPlugin("builtin:module-preload-polyfill", config);
|
|
35
|
+
}
|
|
36
|
+
function dynamicImportVarsPlugin(config) {
|
|
37
|
+
return new BuiltinPlugin("builtin:dynamic-import-vars", config);
|
|
38
|
+
}
|
|
39
|
+
function importGlobPlugin(config) {
|
|
40
|
+
return new BuiltinPlugin("builtin:import-glob", config);
|
|
41
|
+
}
|
|
42
|
+
function reportPlugin(config) {
|
|
43
|
+
return new BuiltinPlugin("builtin:report", config);
|
|
44
|
+
}
|
|
45
|
+
function manifestPlugin(config) {
|
|
46
|
+
return new BuiltinPlugin("builtin:manifest", config);
|
|
47
|
+
}
|
|
48
|
+
function wasmHelperPlugin() {
|
|
49
|
+
return new BuiltinPlugin("builtin:wasm-helper");
|
|
50
|
+
}
|
|
51
|
+
function wasmFallbackPlugin() {
|
|
52
|
+
return new BuiltinPlugin("builtin:wasm-fallback");
|
|
53
|
+
}
|
|
54
|
+
function loadFallbackPlugin() {
|
|
55
|
+
return new BuiltinPlugin("builtin:load-fallback");
|
|
56
|
+
}
|
|
57
|
+
function jsonPlugin(config) {
|
|
58
|
+
return new BuiltinPlugin("builtin:json", config);
|
|
59
|
+
}
|
|
60
|
+
function buildImportAnalysisPlugin(config) {
|
|
61
|
+
return new BuiltinPlugin("builtin:build-import-analysis", config);
|
|
62
|
+
}
|
|
63
|
+
function viteResolvePlugin(config) {
|
|
64
|
+
const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
|
|
65
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
66
|
+
}
|
|
67
|
+
function moduleFederationPlugin(config) {
|
|
68
|
+
return new BuiltinPlugin("builtin:module-federation", {
|
|
69
|
+
...config,
|
|
70
|
+
remotes: config.remotes && Object.entries(config.remotes).map(([name, remote]) => {
|
|
71
|
+
if (typeof remote === "string") {
|
|
72
|
+
const [entryGlobalName] = remote.split("@");
|
|
73
|
+
const entry = remote.replace(entryGlobalName + "@", "");
|
|
74
|
+
return {
|
|
75
|
+
entry,
|
|
76
|
+
name,
|
|
77
|
+
entryGlobalName
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
...remote,
|
|
82
|
+
name: remote.name ?? name
|
|
83
|
+
};
|
|
84
|
+
}),
|
|
85
|
+
manifest: config.manifest === false ? void 0 : config.manifest === true ? {} : config.manifest
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function isolatedDeclarationPlugin(config) {
|
|
89
|
+
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
90
|
+
}
|
|
25
91
|
|
|
26
92
|
//#endregion
|
|
27
93
|
//#region src/utils/misc.ts
|
|
@@ -2001,7 +2067,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
|
|
|
2001
2067
|
}
|
|
2002
2068
|
|
|
2003
2069
|
//#endregion
|
|
2004
|
-
//#region ../pluginutils/dist/esm/
|
|
2070
|
+
//#region ../pluginutils/dist/esm/composable-filters.js
|
|
2005
2071
|
var And = class {
|
|
2006
2072
|
kind;
|
|
2007
2073
|
args;
|
|
@@ -4253,4 +4319,4 @@ function defineConfig(config) {
|
|
|
4253
4319
|
const VERSION = version;
|
|
4254
4320
|
|
|
4255
4321
|
//#endregion
|
|
4256
|
-
export { VERSION, build, defineConfig, rolldown, watch };
|
|
4322
|
+
export { BuiltinPlugin, VERSION, build, buildImportAnalysisPlugin, composeJsPlugins, createBundler, defineConfig, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, rolldown, 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.56abf23",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"type": "module",
|
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
"types": "./dist/index.d.cts",
|
|
32
32
|
"exports": {
|
|
33
33
|
".": {
|
|
34
|
-
"browser": "./dist/browser.mjs",
|
|
34
|
+
"browser": "./dist/index.browser.mjs",
|
|
35
35
|
"require": "./dist/index.cjs",
|
|
36
36
|
"import": "./dist/index.mjs"
|
|
37
37
|
},
|
|
38
38
|
"./experimental": {
|
|
39
|
+
"browser": "./dist/experimental-index.browser.mjs",
|
|
39
40
|
"require": "./dist/experimental-index.cjs",
|
|
40
41
|
"import": "./dist/experimental-index.mjs"
|
|
41
42
|
},
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"dependencies": {
|
|
57
58
|
"@napi-rs/wasm-runtime": "^0.2.8",
|
|
58
59
|
"@oxc-project/types": "0.68.1",
|
|
59
|
-
"ansis": "^
|
|
60
|
+
"ansis": "^4.0.0",
|
|
60
61
|
"pathe": "^2.0.3"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|