@rolldown/browser 1.0.0-beta.9-commit.ca4e9dd → 1.0.0-rc.1
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-setup.mjs +16 -0
- package/dist/cli.mjs +1084 -1281
- package/dist/config.d.mts +1 -3
- package/dist/config.mjs +7 -5
- package/dist/constructors-B8gqcrFr.js +61 -0
- package/dist/experimental-index.browser.mjs +225 -50
- package/dist/experimental-index.d.mts +164 -76
- package/dist/experimental-index.mjs +220 -60
- package/dist/experimental-runtime-types.d.ts +98 -0
- package/dist/filter-index.d.mts +104 -2
- package/dist/filter-index.mjs +123 -3
- package/dist/get-log-filter.d.mts +7 -0
- package/dist/get-log-filter.mjs +48 -0
- package/dist/index.browser.mjs +242 -2
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +54 -5
- package/dist/{shared/parse-ast-index-BHaE0ECV.cjs → normalize-string-or-regex-CL-PJZI7.js} +70 -137
- package/dist/parallel-plugin-worker.mjs +26 -33
- package/dist/parallel-plugin.d.mts +7 -7
- package/dist/parse-ast-index.d.mts +5 -6
- package/dist/parse-ast-index.mjs +1 -2
- package/dist/plugins-index.browser.mjs +39 -0
- package/dist/plugins-index.d.mts +30 -0
- package/dist/plugins-index.mjs +39 -0
- package/dist/rolldown-binding.wasi-browser.js +41 -24
- package/dist/rolldown-binding.wasi.cjs +62 -24
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/rolldown-build-C4tDS_XC.js +5055 -0
- package/dist/shared/bindingify-input-options-Bp2kpiI8.mjs +2231 -0
- package/dist/shared/composable-filters-CIxSuZSM.mjs +227 -0
- package/dist/shared/constructors-5bt5oBhE.d.mts +28 -0
- package/dist/shared/constructors-BTW-c3jX.mjs +61 -0
- package/dist/shared/define-config-CDlEOpr1.d.mts +3531 -0
- package/dist/shared/define-config-Dlptvz3X.mjs +7 -0
- package/dist/shared/{load-config-vRugYmJ3.mjs → load-config-BBZgIUGN.mjs} +23 -33
- package/dist/shared/logging-Nvu645a7.d.mts +50 -0
- package/dist/shared/{parse-ast-index-vu376yZ1.mjs → logs-B2CASPcx.mjs} +21 -116
- package/dist/shared/normalize-string-or-regex-DIwprzLy.mjs +60 -0
- package/dist/shared/parse-ast-index-2ahkCVK6.mjs +98 -0
- package/dist/shared/{prompt-CxjDC0Gn.cjs → prompt-B6NrDD1-.mjs} +301 -308
- package/dist/shared/rolldown-C0_W0QdY.mjs +42 -0
- package/dist/shared/rolldown-build-DLuUhuNw.mjs +2368 -0
- package/dist/shared/types-CIYK49jr.d.mts +1300 -0
- package/dist/shared/utils-CqMTwlsR.d.mts +22 -0
- package/dist/shared/watch-eIop0yN6.mjs +378 -0
- package/package.json +33 -38
- package/dist/cli.cjs +0 -1748
- package/dist/config.cjs +0 -12
- package/dist/config.d.cts +0 -11
- package/dist/experimental-index.cjs +0 -129
- package/dist/experimental-index.d.cts +0 -96
- package/dist/filter-index.cjs +0 -53
- package/dist/filter-index.d.cts +0 -3
- package/dist/index.cjs +0 -9
- package/dist/index.d.cts +0 -3
- package/dist/parallel-plugin-worker.cjs +0 -33
- package/dist/parallel-plugin-worker.d.cts +0 -1
- package/dist/parallel-plugin.cjs +0 -8
- package/dist/parallel-plugin.d.cts +0 -14
- package/dist/parse-ast-index.cjs +0 -4
- package/dist/parse-ast-index.d.cts +0 -9
- package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
- package/dist/shared/chunk-DSsiIF1Z.mjs +0 -30
- package/dist/shared/define-config.d-D4lKXE9V.d.cts +0 -1165
- package/dist/shared/define-config.d-Dm9iNdt9.d.mts +0 -1165
- package/dist/shared/dist-BMVjvV-v.cjs +0 -249
- package/dist/shared/dist-CAn6dxW6.mjs +0 -153
- package/dist/shared/load-config-42uI5RSv.cjs +0 -125
- package/dist/shared/prompt-GFYxfPw7.mjs +0 -854
- package/dist/shared/src-Cu4_wKhx.mjs +0 -4691
- package/dist/shared/src-CzdOBfDC.cjs +0 -4647
- package/dist/src-DQ33eKZS.js +0 -4333
- /package/dist/{cli.d.cts → cli-setup.d.mts} +0 -0
|
@@ -1,38 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PluginContextData,
|
|
3
|
-
import "./shared/
|
|
4
|
-
import "./shared/parse-ast-index-vu376yZ1.mjs";
|
|
5
|
-
import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
|
1
|
+
import "./shared/normalize-string-or-regex-DIwprzLy.mjs";
|
|
2
|
+
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-Bp2kpiI8.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-2ahkCVK6.mjs";
|
|
6
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
|
+
import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
|
7
6
|
|
|
8
7
|
//#region src/parallel-plugin-worker.ts
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
} finally {
|
|
32
|
-
parentPort.unref();
|
|
33
|
-
}
|
|
34
|
-
})();
|
|
35
|
-
} });
|
|
8
|
+
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
9
|
+
(async () => {
|
|
10
|
+
try {
|
|
11
|
+
registerPlugins(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
12
|
+
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
|
|
13
|
+
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
14
|
+
return {
|
|
15
|
+
index: pluginInfo.index,
|
|
16
|
+
plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, []), [], () => {}, "info", false)
|
|
17
|
+
};
|
|
18
|
+
})));
|
|
19
|
+
parentPort.postMessage({ type: "success" });
|
|
20
|
+
} catch (error) {
|
|
21
|
+
parentPort.postMessage({
|
|
22
|
+
type: "error",
|
|
23
|
+
error
|
|
24
|
+
});
|
|
25
|
+
} finally {
|
|
26
|
+
parentPort.unref();
|
|
27
|
+
}
|
|
28
|
+
})();
|
|
36
29
|
|
|
37
30
|
//#endregion
|
|
38
|
-
export
|
|
31
|
+
export { };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as Plugin } from "./shared/define-config-CDlEOpr1.mjs";
|
|
2
|
+
import { i as MaybePromise } from "./shared/utils-CqMTwlsR.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
4
5
|
type ParallelPluginImplementation = Plugin;
|
|
5
6
|
type Context = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Thread number
|
|
9
|
+
*/
|
|
10
|
+
threadNumber: number;
|
|
10
11
|
};
|
|
11
12
|
declare function defineParallelPluginImplementation<Options>(plugin: (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>): (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>;
|
|
12
|
-
|
|
13
13
|
//#endregion
|
|
14
|
-
export { Context, ParallelPluginImplementation, defineParallelPluginImplementation };
|
|
14
|
+
export { type Context, type ParallelPluginImplementation, defineParallelPluginImplementation };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as Program } from "./shared/types-CIYK49jr.mjs";
|
|
2
|
+
import { ParseResult, ParserOptions } from "./binding.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/parse-ast-index.d.ts
|
|
5
|
-
declare function parseAst(sourceText: string, options?: ParserOptions |
|
|
6
|
-
declare function parseAstAsync(sourceText: string, options?: ParserOptions |
|
|
7
|
-
|
|
5
|
+
declare function parseAst(sourceText: string, options?: ParserOptions | null, filename?: string): Program;
|
|
6
|
+
declare function parseAstAsync(sourceText: string, options?: ParserOptions | null, filename?: string): Promise<Program>;
|
|
8
7
|
//#endregion
|
|
9
|
-
export { ParseResult, ParserOptions, parseAst, parseAstAsync };
|
|
8
|
+
export { type ParseResult, type ParserOptions, parseAst, parseAstAsync };
|
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./normalize-string-or-regex-CL-PJZI7.js";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./constructors-B8gqcrFr.js";
|
|
3
|
+
|
|
4
|
+
//#region src/builtin-plugin/replace-plugin.ts
|
|
5
|
+
/**
|
|
6
|
+
* Replaces targeted strings in files while bundling.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Basic usage
|
|
10
|
+
* ```js
|
|
11
|
+
* replacePlugin({
|
|
12
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
13
|
+
* __buildVersion: 15
|
|
14
|
+
* })
|
|
15
|
+
* ```
|
|
16
|
+
* @example
|
|
17
|
+
* // With options
|
|
18
|
+
* ```js
|
|
19
|
+
* replacePlugin({
|
|
20
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
21
|
+
* __buildVersion: 15
|
|
22
|
+
* }, {
|
|
23
|
+
* preventAssignment: false,
|
|
24
|
+
* })
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
function replacePlugin(values = {}, options = {}) {
|
|
28
|
+
Object.keys(values).forEach((key) => {
|
|
29
|
+
const value = values[key];
|
|
30
|
+
if (typeof value !== "string") values[key] = String(value);
|
|
31
|
+
});
|
|
32
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
|
|
33
|
+
...options,
|
|
34
|
+
values
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { esmExternalRequirePlugin, replacePlugin };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { t as BuiltinPlugin } from "./shared/utils-CqMTwlsR.mjs";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-5bt5oBhE.mjs";
|
|
3
|
+
import { BindingReplacePluginConfig } from "../binding.cjs";
|
|
4
|
+
|
|
5
|
+
//#region src/builtin-plugin/replace-plugin.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Replaces targeted strings in files while bundling.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Basic usage
|
|
11
|
+
* ```js
|
|
12
|
+
* replacePlugin({
|
|
13
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
14
|
+
* __buildVersion: 15
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
* @example
|
|
18
|
+
* // With options
|
|
19
|
+
* ```js
|
|
20
|
+
* replacePlugin({
|
|
21
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
22
|
+
* __buildVersion: 15
|
|
23
|
+
* }, {
|
|
24
|
+
* preventAssignment: false,
|
|
25
|
+
* })
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare function replacePlugin(values?: BindingReplacePluginConfig["values"], options?: Omit<BindingReplacePluginConfig, "values">): BuiltinPlugin;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { esmExternalRequirePlugin, replacePlugin };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-DIwprzLy.mjs";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-BTW-c3jX.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/builtin-plugin/replace-plugin.ts
|
|
5
|
+
/**
|
|
6
|
+
* Replaces targeted strings in files while bundling.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* // Basic usage
|
|
10
|
+
* ```js
|
|
11
|
+
* replacePlugin({
|
|
12
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
13
|
+
* __buildVersion: 15
|
|
14
|
+
* })
|
|
15
|
+
* ```
|
|
16
|
+
* @example
|
|
17
|
+
* // With options
|
|
18
|
+
* ```js
|
|
19
|
+
* replacePlugin({
|
|
20
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
21
|
+
* __buildVersion: 15
|
|
22
|
+
* }, {
|
|
23
|
+
* preventAssignment: false,
|
|
24
|
+
* })
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
function replacePlugin(values = {}, options = {}) {
|
|
28
|
+
Object.keys(values).forEach((key) => {
|
|
29
|
+
const value = values[key];
|
|
30
|
+
if (typeof value !== "string") values[key] = String(value);
|
|
31
|
+
});
|
|
32
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
|
|
33
|
+
...options,
|
|
34
|
+
values
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { esmExternalRequirePlugin, replacePlugin };
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
WASI as __WASI,
|
|
6
6
|
} from '@napi-rs/wasm-runtime'
|
|
7
7
|
import { memfs } from '@napi-rs/wasm-runtime/fs'
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
|
|
10
10
|
export const { fs: __fs, vol: __volume } = memfs()
|
|
11
11
|
|
|
@@ -17,8 +17,10 @@ const __wasi = new __WASI({
|
|
|
17
17
|
},
|
|
18
18
|
})
|
|
19
19
|
|
|
20
|
+
const __wasmUrl = new URL('./rolldown-binding.wasm32-wasi.wasm', import.meta.url).href
|
|
20
21
|
const __emnapiContext = __emnapiGetDefaultContext()
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
const __sharedMemory = new WebAssembly.Memory({
|
|
23
25
|
initial: 16384,
|
|
24
26
|
maximum: 65536,
|
|
@@ -61,49 +63,64 @@ const {
|
|
|
61
63
|
},
|
|
62
64
|
})
|
|
63
65
|
export default __napiModule.exports
|
|
66
|
+
export const minify = __napiModule.exports.minify
|
|
67
|
+
export const minifySync = __napiModule.exports.minifySync
|
|
68
|
+
export const Severity = __napiModule.exports.Severity
|
|
69
|
+
export const ParseResult = __napiModule.exports.ParseResult
|
|
70
|
+
export const ExportExportNameKind = __napiModule.exports.ExportExportNameKind
|
|
71
|
+
export const ExportImportNameKind = __napiModule.exports.ExportImportNameKind
|
|
72
|
+
export const ExportLocalNameKind = __napiModule.exports.ExportLocalNameKind
|
|
73
|
+
export const ImportNameKind = __napiModule.exports.ImportNameKind
|
|
74
|
+
export const parse = __napiModule.exports.parse
|
|
75
|
+
export const parseSync = __napiModule.exports.parseSync
|
|
76
|
+
export const rawTransferSupported = __napiModule.exports.rawTransferSupported
|
|
77
|
+
export const ResolverFactory = __napiModule.exports.ResolverFactory
|
|
78
|
+
export const EnforceExtension = __napiModule.exports.EnforceExtension
|
|
79
|
+
export const ModuleType = __napiModule.exports.ModuleType
|
|
80
|
+
export const sync = __napiModule.exports.sync
|
|
81
|
+
export const HelperMode = __napiModule.exports.HelperMode
|
|
82
|
+
export const isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
83
|
+
export const isolatedDeclarationSync = __napiModule.exports.isolatedDeclarationSync
|
|
84
|
+
export const moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
85
|
+
export const moduleRunnerTransformSync = __napiModule.exports.moduleRunnerTransformSync
|
|
86
|
+
export const transform = __napiModule.exports.transform
|
|
87
|
+
export const transformSync = __napiModule.exports.transformSync
|
|
64
88
|
export const BindingBundleEndEventData = __napiModule.exports.BindingBundleEndEventData
|
|
65
89
|
export const BindingBundleErrorEventData = __napiModule.exports.BindingBundleErrorEventData
|
|
90
|
+
export const BindingBundler = __napiModule.exports.BindingBundler
|
|
66
91
|
export const BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin
|
|
67
|
-
export const
|
|
92
|
+
export const BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
93
|
+
export const BindingDecodedMap = __napiModule.exports.BindingDecodedMap
|
|
94
|
+
export const BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
95
|
+
export const BindingMagicString = __napiModule.exports.BindingMagicString
|
|
68
96
|
export const BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
69
97
|
export const BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
70
98
|
export const BindingOutputAsset = __napiModule.exports.BindingOutputAsset
|
|
71
99
|
export const BindingOutputChunk = __napiModule.exports.BindingOutputChunk
|
|
72
|
-
export const BindingOutputs = __napiModule.exports.BindingOutputs
|
|
73
100
|
export const BindingPluginContext = __napiModule.exports.BindingPluginContext
|
|
74
101
|
export const BindingRenderedChunk = __napiModule.exports.BindingRenderedChunk
|
|
75
102
|
export const BindingRenderedChunkMeta = __napiModule.exports.BindingRenderedChunkMeta
|
|
76
103
|
export const BindingRenderedModule = __napiModule.exports.BindingRenderedModule
|
|
104
|
+
export const BindingSourceMap = __napiModule.exports.BindingSourceMap
|
|
77
105
|
export const BindingTransformPluginContext = __napiModule.exports.BindingTransformPluginContext
|
|
78
106
|
export const BindingWatcher = __napiModule.exports.BindingWatcher
|
|
107
|
+
export const BindingWatcherBundler = __napiModule.exports.BindingWatcherBundler
|
|
79
108
|
export const BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
|
|
80
109
|
export const BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
81
|
-
export const Bundler = __napiModule.exports.Bundler
|
|
82
110
|
export const ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
|
|
83
|
-
export const
|
|
84
|
-
export const
|
|
111
|
+
export const ScheduledBuild = __napiModule.exports.ScheduledBuild
|
|
112
|
+
export const TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
113
|
+
export const BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
85
114
|
export const BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
86
|
-
export const
|
|
87
|
-
export const BindingJsx = __napiModule.exports.BindingJsx
|
|
115
|
+
export const BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
88
116
|
export const BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
89
117
|
export const BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
90
|
-
export const
|
|
91
|
-
export const
|
|
92
|
-
export const
|
|
93
|
-
export const
|
|
118
|
+
export const BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
119
|
+
export const BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
120
|
+
export const BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
121
|
+
export const createTokioRuntime = __napiModule.exports.createTokioRuntime
|
|
94
122
|
export const FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
95
|
-
export const
|
|
96
|
-
export const HelperMode = __napiModule.exports.HelperMode
|
|
97
|
-
export const ImportNameKind = __napiModule.exports.ImportNameKind
|
|
98
|
-
export const isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
99
|
-
export const moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
100
|
-
export const parseAsync = __napiModule.exports.parseAsync
|
|
101
|
-
export const parseSync = __napiModule.exports.parseSync
|
|
102
|
-
export const parseSyncRaw = __napiModule.exports.parseSyncRaw
|
|
103
|
-
export const rawTransferSupported = __napiModule.exports.rawTransferSupported
|
|
123
|
+
export const initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
104
124
|
export const registerPlugins = __napiModule.exports.registerPlugins
|
|
105
|
-
export const Severity = __napiModule.exports.Severity
|
|
106
125
|
export const shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
107
126
|
export const startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
108
|
-
export const sync = __napiModule.exports.sync
|
|
109
|
-
export const transform = __napiModule.exports.transform
|
|
@@ -39,7 +39,7 @@ if (__nodeFs.existsSync(__wasmDebugFilePath)) {
|
|
|
39
39
|
__wasmFilePath = __wasmDebugFilePath
|
|
40
40
|
} else if (!__nodeFs.existsSync(__wasmFilePath)) {
|
|
41
41
|
try {
|
|
42
|
-
__wasmFilePath =
|
|
42
|
+
__wasmFilePath = require.resolve('@rolldown/binding-wasm32-wasi/rolldown-binding.wasm32-wasi.wasm')
|
|
43
43
|
} catch {
|
|
44
44
|
throw new Error('Cannot find rolldown-binding.wasm32-wasi.wasm file, and @rolldown/binding-wasm32-wasi package is not installed.')
|
|
45
45
|
}
|
|
@@ -65,6 +65,29 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
|
|
|
65
65
|
worker.onmessage = ({ data }) => {
|
|
66
66
|
__wasmCreateOnMessageForFsProxy(__nodeFs)(data)
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
// The main thread of Node.js waits for all the active handles before exiting.
|
|
70
|
+
// But Rust threads are never waited without `thread::join`.
|
|
71
|
+
// So here we hack the code of Node.js to prevent the workers from being referenced (active).
|
|
72
|
+
// According to https://github.com/nodejs/node/blob/19e0d472728c79d418b74bddff588bea70a403d0/lib/internal/worker.js#L415,
|
|
73
|
+
// a worker is consist of two handles: kPublicPort and kHandle.
|
|
74
|
+
{
|
|
75
|
+
const kPublicPort = Object.getOwnPropertySymbols(worker).find(s =>
|
|
76
|
+
s.toString().includes("kPublicPort")
|
|
77
|
+
);
|
|
78
|
+
if (kPublicPort) {
|
|
79
|
+
worker[kPublicPort].ref = () => {};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const kHandle = Object.getOwnPropertySymbols(worker).find(s =>
|
|
83
|
+
s.toString().includes("kHandle")
|
|
84
|
+
);
|
|
85
|
+
if (kHandle) {
|
|
86
|
+
worker[kHandle].ref = () => {};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
worker.unref();
|
|
90
|
+
}
|
|
68
91
|
return worker
|
|
69
92
|
},
|
|
70
93
|
overwriteImports(importObject) {
|
|
@@ -85,49 +108,64 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
|
|
|
85
108
|
},
|
|
86
109
|
})
|
|
87
110
|
module.exports = __napiModule.exports
|
|
111
|
+
module.exports.minify = __napiModule.exports.minify
|
|
112
|
+
module.exports.minifySync = __napiModule.exports.minifySync
|
|
113
|
+
module.exports.Severity = __napiModule.exports.Severity
|
|
114
|
+
module.exports.ParseResult = __napiModule.exports.ParseResult
|
|
115
|
+
module.exports.ExportExportNameKind = __napiModule.exports.ExportExportNameKind
|
|
116
|
+
module.exports.ExportImportNameKind = __napiModule.exports.ExportImportNameKind
|
|
117
|
+
module.exports.ExportLocalNameKind = __napiModule.exports.ExportLocalNameKind
|
|
118
|
+
module.exports.ImportNameKind = __napiModule.exports.ImportNameKind
|
|
119
|
+
module.exports.parse = __napiModule.exports.parse
|
|
120
|
+
module.exports.parseSync = __napiModule.exports.parseSync
|
|
121
|
+
module.exports.rawTransferSupported = __napiModule.exports.rawTransferSupported
|
|
122
|
+
module.exports.ResolverFactory = __napiModule.exports.ResolverFactory
|
|
123
|
+
module.exports.EnforceExtension = __napiModule.exports.EnforceExtension
|
|
124
|
+
module.exports.ModuleType = __napiModule.exports.ModuleType
|
|
125
|
+
module.exports.sync = __napiModule.exports.sync
|
|
126
|
+
module.exports.HelperMode = __napiModule.exports.HelperMode
|
|
127
|
+
module.exports.isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
128
|
+
module.exports.isolatedDeclarationSync = __napiModule.exports.isolatedDeclarationSync
|
|
129
|
+
module.exports.moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
130
|
+
module.exports.moduleRunnerTransformSync = __napiModule.exports.moduleRunnerTransformSync
|
|
131
|
+
module.exports.transform = __napiModule.exports.transform
|
|
132
|
+
module.exports.transformSync = __napiModule.exports.transformSync
|
|
88
133
|
module.exports.BindingBundleEndEventData = __napiModule.exports.BindingBundleEndEventData
|
|
89
134
|
module.exports.BindingBundleErrorEventData = __napiModule.exports.BindingBundleErrorEventData
|
|
135
|
+
module.exports.BindingBundler = __napiModule.exports.BindingBundler
|
|
90
136
|
module.exports.BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin
|
|
91
|
-
module.exports.
|
|
137
|
+
module.exports.BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
138
|
+
module.exports.BindingDecodedMap = __napiModule.exports.BindingDecodedMap
|
|
139
|
+
module.exports.BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
140
|
+
module.exports.BindingMagicString = __napiModule.exports.BindingMagicString
|
|
92
141
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
93
142
|
module.exports.BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
94
143
|
module.exports.BindingOutputAsset = __napiModule.exports.BindingOutputAsset
|
|
95
144
|
module.exports.BindingOutputChunk = __napiModule.exports.BindingOutputChunk
|
|
96
|
-
module.exports.BindingOutputs = __napiModule.exports.BindingOutputs
|
|
97
145
|
module.exports.BindingPluginContext = __napiModule.exports.BindingPluginContext
|
|
98
146
|
module.exports.BindingRenderedChunk = __napiModule.exports.BindingRenderedChunk
|
|
99
147
|
module.exports.BindingRenderedChunkMeta = __napiModule.exports.BindingRenderedChunkMeta
|
|
100
148
|
module.exports.BindingRenderedModule = __napiModule.exports.BindingRenderedModule
|
|
149
|
+
module.exports.BindingSourceMap = __napiModule.exports.BindingSourceMap
|
|
101
150
|
module.exports.BindingTransformPluginContext = __napiModule.exports.BindingTransformPluginContext
|
|
102
151
|
module.exports.BindingWatcher = __napiModule.exports.BindingWatcher
|
|
152
|
+
module.exports.BindingWatcherBundler = __napiModule.exports.BindingWatcherBundler
|
|
103
153
|
module.exports.BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
|
|
104
154
|
module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
105
|
-
module.exports.Bundler = __napiModule.exports.Bundler
|
|
106
155
|
module.exports.ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
|
|
107
|
-
module.exports.
|
|
108
|
-
module.exports.
|
|
156
|
+
module.exports.ScheduledBuild = __napiModule.exports.ScheduledBuild
|
|
157
|
+
module.exports.TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
158
|
+
module.exports.BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
109
159
|
module.exports.BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
110
|
-
module.exports.
|
|
111
|
-
module.exports.BindingJsx = __napiModule.exports.BindingJsx
|
|
160
|
+
module.exports.BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
112
161
|
module.exports.BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
113
162
|
module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
114
|
-
module.exports.
|
|
115
|
-
module.exports.
|
|
116
|
-
module.exports.
|
|
117
|
-
module.exports.
|
|
163
|
+
module.exports.BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
164
|
+
module.exports.BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
165
|
+
module.exports.BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
166
|
+
module.exports.createTokioRuntime = __napiModule.exports.createTokioRuntime
|
|
118
167
|
module.exports.FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
119
|
-
module.exports.
|
|
120
|
-
module.exports.HelperMode = __napiModule.exports.HelperMode
|
|
121
|
-
module.exports.ImportNameKind = __napiModule.exports.ImportNameKind
|
|
122
|
-
module.exports.isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
123
|
-
module.exports.moduleRunnerTransform = __napiModule.exports.moduleRunnerTransform
|
|
124
|
-
module.exports.parseAsync = __napiModule.exports.parseAsync
|
|
125
|
-
module.exports.parseSync = __napiModule.exports.parseSync
|
|
126
|
-
module.exports.parseSyncRaw = __napiModule.exports.parseSyncRaw
|
|
127
|
-
module.exports.rawTransferSupported = __napiModule.exports.rawTransferSupported
|
|
168
|
+
module.exports.initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
128
169
|
module.exports.registerPlugins = __napiModule.exports.registerPlugins
|
|
129
|
-
module.exports.Severity = __napiModule.exports.Severity
|
|
130
170
|
module.exports.shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
131
171
|
module.exports.startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
132
|
-
module.exports.sync = __napiModule.exports.sync
|
|
133
|
-
module.exports.transform = __napiModule.exports.transform
|
|
Binary file
|