@voidzero-dev/vite-plus-core 1.0.0-rc.0 → 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/rolldown/cli.mjs +6 -6
- package/dist/rolldown/config.d.mts +1 -1
- package/dist/rolldown/config.mjs +2 -2
- package/dist/rolldown/experimental-index.d.mts +8 -5
- package/dist/rolldown/experimental-index.mjs +14 -11
- package/dist/rolldown/experimental-runtime-types.d.ts +3 -26
- package/dist/rolldown/experimental-runtime.d.ts +3 -26
- package/dist/rolldown/experimental-runtime.mjs +4 -47
- package/dist/rolldown/filter-index.d.mts +1 -1
- package/dist/rolldown/index.d.mts +1 -1
- package/dist/rolldown/index.mjs +4 -4
- package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
- package/dist/rolldown/parallel-plugin.d.mts +1 -1
- package/dist/rolldown/parse-ast-index.mjs +2 -2
- package/dist/rolldown/plugins-index.d.mts +2 -2
- package/dist/rolldown/plugins-index.mjs +2 -2
- package/dist/rolldown/shared/{binding-BbrDfv1x.mjs → binding-BY0qR5iS.mjs} +28 -27
- package/dist/rolldown/shared/{bindingify-input-options-CbBAjvu6.mjs → bindingify-input-options-B8JHmN6_.mjs} +10 -8
- package/dist/rolldown/shared/{constructors-CmDKpWIU.d.mts → constructors-DuOq7MqW.d.mts} +1 -1
- package/dist/rolldown/shared/{constructors-D9jwEbE4.mjs → constructors-xEvVj3lN.mjs} +1 -1
- package/dist/rolldown/shared/{create-bundler-option-wxuQPB7F.mjs → create-bundler-option-COco-7P6.mjs} +93 -19
- package/dist/rolldown/shared/{define-config-BFdLpVut.d.mts → define-config-C7HCoqY8.d.mts} +11 -1
- package/dist/rolldown/shared/{error-CGhV1ebk.mjs → error-C7pxws0W.mjs} +1 -1
- package/dist/rolldown/shared/{load-config-DOMKIWz0.mjs → load-config-DkUBnDsI.mjs} +1 -1
- package/dist/rolldown/shared/{logs-DmYCAKcW.mjs → logs-D6uA606S.mjs} +8 -1
- package/dist/rolldown/shared/{normalize-string-or-regex-zc1bUto6.mjs → normalize-string-or-regex-F14uvr6D.mjs} +2 -2
- package/dist/rolldown/shared/{parse-6TJ5OMPh.mjs → parse-BWeE7Vr9.mjs} +1 -1
- package/dist/rolldown/shared/{resolve-tsconfig-Bf6oL9fm.mjs → resolve-tsconfig-DHwpIs5e.mjs} +2 -2
- package/dist/rolldown/shared/{rolldown-DZGaRc5R.mjs → rolldown-Bue0gNT5.mjs} +4 -4
- package/dist/rolldown/shared/{watch-CUKYWzxY.mjs → watch-RXhXN1aG.mjs} +5 -5
- package/dist/rolldown/utils-index.mjs +2 -2
- package/dist/tsdown/{build-JVmLFaZt-BN9yuB6k.js → build-JVmLFaZt-DRlLhpV3.js} +10 -8
- package/dist/tsdown/{debug-CpC4hV25-BeCITV83.js → debug-CpC4hV25-C-OYr2iI.js} +4 -3
- package/dist/tsdown/{detect-Bg-d8iUV-Cr_BRLVW.js → detect-Bg-d8iUV-Du8LljhG.js} +1 -1
- package/dist/tsdown/{dist-ByW_jJfv.js → dist-VDcV1Qyy.js} +19 -49
- package/dist/tsdown/index-types.d.ts +209 -209
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/{main-bgV9NlwM.js → main-CyNcZUzu.js} +3 -88
- package/dist/tsdown/require-BbBF8Ii0-BDaWJgzA.js +320 -0
- package/dist/tsdown/{resolver-DE0_sy8o-UMsN-SXx.js → resolver-DE0_sy8o-Bi3xbRxi.js} +2 -3
- package/dist/tsdown/run.js +5 -4
- package/dist/tsdown/{src-D5xv98Iu.js → src-pN7Bl6zo.js} +4 -4
- package/dist/tsdown/style-DiMP8pYv-DIC5PXeH.js +88 -0
- package/dist/tsdown/{target-DgdLrXba-DaJJ11xX.js → target-DgdLrXba-DpO9JXxB.js} +6 -172
- package/dist/tsdown/{tsc-BFDF_Im9.js → tsc-BLb4pSBY.js} +8 -7
- package/dist/tsdown/tsdown-css.js +4 -5
- package/dist/tsdown/tsdown-exe.js +41 -4
- package/dist/tsdown/version-CQ98ZBpL-D6GAHapk.js +169 -0
- package/dist/vite/client/bundledDevClient.mjs +8 -42
- package/dist/vite/client/client.mjs +4 -4
- package/dist/vite/node/chunks/dist2.js +107 -104
- package/dist/vite/node/chunks/node.js +303 -100
- package/dist/vite/node/index.d.ts +4 -3
- package/package.json +14 -14
- package/dist/tsdown/internal-DTYQdXId.js +0 -3
package/dist/rolldown/cli.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
2
|
-
import { D as version, E as description } from "./shared/bindingify-input-options-
|
|
1
|
+
import { n as onExit, t as watch } from "./shared/watch-RXhXN1aG.mjs";
|
|
2
|
+
import { D as version, E as description } from "./shared/bindingify-input-options-B8JHmN6_.mjs";
|
|
3
3
|
import { t as arraify } from "./shared/misc-DOSKtd97.mjs";
|
|
4
|
-
import { a as getOutputCliKeys, c as styleText, i as getInputCliKeys, n as logger, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/create-bundler-option-
|
|
5
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
6
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
4
|
+
import { a as getOutputCliKeys, c as styleText, i as getInputCliKeys, n as logger, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/create-bundler-option-COco-7P6.mjs";
|
|
5
|
+
import { t as rolldown } from "./shared/rolldown-Bue0gNT5.mjs";
|
|
6
|
+
import { t as loadConfig } from "./shared/load-config-DkUBnDsI.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import g$1 from "node:process";
|
|
9
9
|
import { performance } from "node:perf_hooks";
|
|
@@ -866,7 +866,7 @@ function getClearScreenFunction(options) {
|
|
|
866
866
|
};
|
|
867
867
|
}
|
|
868
868
|
//#endregion
|
|
869
|
-
//#region \0@oxc-project+runtime@0.
|
|
869
|
+
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/usingCtx.js
|
|
870
870
|
function _usingCtx() {
|
|
871
871
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
872
872
|
var n = Error();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-
|
|
1
|
+
import { R as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-C7HCoqY8.mjs";
|
|
2
2
|
//#region src/utils/load-config.d.ts
|
|
3
3
|
type ConfigLoader = "bundle" | "native";
|
|
4
4
|
interface LoadConfigOptions {
|
package/dist/rolldown/config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as VERSION } from "./shared/bindingify-input-options-
|
|
1
|
+
import { T as VERSION } from "./shared/bindingify-input-options-B8JHmN6_.mjs";
|
|
2
2
|
import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
|
|
3
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
3
|
+
import { t as loadConfig } from "./shared/load-config-DkUBnDsI.mjs";
|
|
4
4
|
export { VERSION, defineConfig, loadConfig };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $ as resetNativeMemoryStats, B as NapiResolveOptions, E as BindingViteManifestPluginConfig, F as IsolatedDeclarationsResult, G as ResolverFactory, P as IsolatedDeclarationsOptions, Q as moduleRunnerTransform, W as ResolveResult, X as isolatedDeclaration, Y as getNativeMemoryStats, Z as isolatedDeclarationSync, b as BindingTsconfigRawOptions, f as BindingModuleInfo, h as BindingRebuildStrategy, i as BindingClientHmrUpdate, j as BindingViteTransformPluginConfig, n as BindingBundleAnalyzerPluginConfig, p as BindingNativeMemoryStats, r as BindingBundleState, u as BindingLazyChunkOutput, y as BindingTsconfigCompilerOptions } from "./shared/binding-BTa6BPQe.mjs";
|
|
2
|
-
import { $ as defineParallelPlugin, $t as freeExternalMemory, Ht as OutputOptions, I as BuiltinPlugin, Kt as StringOrRegExp, Zt as RolldownOutput, l as InputOptions, ut as NormalizedOutputOptions } from "./shared/define-config-
|
|
2
|
+
import { $ as defineParallelPlugin, $t as freeExternalMemory, Ht as OutputOptions, I as BuiltinPlugin, Kt as StringOrRegExp, Zt as RolldownOutput, l as InputOptions, ut as NormalizedOutputOptions } from "./shared/define-config-C7HCoqY8.mjs";
|
|
3
3
|
import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-DK_nCt9j.mjs";
|
|
4
|
-
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-
|
|
4
|
+
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-DuOq7MqW.mjs";
|
|
5
5
|
//#region src/api/dev/dev-options.d.ts
|
|
6
6
|
type DevOnHmrUpdates = (result: Error | {
|
|
7
7
|
updates: BindingClientHmrUpdate[];
|
|
@@ -145,8 +145,11 @@ declare class DevEngine {
|
|
|
145
145
|
*/
|
|
146
146
|
registerClient(clientId: string): Promise<void>;
|
|
147
147
|
/**
|
|
148
|
-
* Delivery notification
|
|
149
|
-
*
|
|
148
|
+
* Delivery notification for the payload `filename`. Call it when the client
|
|
149
|
+
* reports that it ran the payload (Vite appends a
|
|
150
|
+
* `__rolldown_runtime__.payloadDelivered(filename)` statement to every patch
|
|
151
|
+
* and lazy chunk). A completed HTTP response is not enough: the bytes may not
|
|
152
|
+
* have evaluated yet. Records the payload's modules as shipped to that client.
|
|
150
153
|
*/
|
|
151
154
|
notifyPayloadDelivered(filename: string): Promise<void>;
|
|
152
155
|
removeClient(clientId: string): Promise<void>;
|
|
@@ -161,7 +164,7 @@ declare class DevEngine {
|
|
|
161
164
|
* @param moduleId - The absolute file path of the module to compile
|
|
162
165
|
* @param clientId - The client ID requesting this compilation
|
|
163
166
|
* @returns The compiled chunk: its code plus the filename whose delivery the
|
|
164
|
-
*
|
|
167
|
+
* dev server reports via {@link notifyPayloadDelivered}
|
|
165
168
|
*/
|
|
166
169
|
compileEntry(moduleId: string, clientId: string): Promise<BindingLazyChunkOutput>;
|
|
167
170
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-
|
|
3
|
-
import { u as transformToRollupOutput } from "./shared/bindingify-input-options-
|
|
4
|
-
import { l as PluginDriver, s as validateOption, t as createBundlerOptions } from "./shared/create-bundler-option-
|
|
5
|
-
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-
|
|
6
|
-
import { n as parseSync$1, t as parse$1 } from "./shared/parse-
|
|
7
|
-
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-
|
|
8
|
-
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-BY0qR5iS.mjs";
|
|
2
|
+
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-F14uvr6D.mjs";
|
|
3
|
+
import { u as transformToRollupOutput } from "./shared/bindingify-input-options-B8JHmN6_.mjs";
|
|
4
|
+
import { l as PluginDriver, s as validateOption, t as createBundlerOptions } from "./shared/create-bundler-option-COco-7P6.mjs";
|
|
5
|
+
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-C7pxws0W.mjs";
|
|
6
|
+
import { n as parseSync$1, t as parse$1 } from "./shared/parse-BWeE7Vr9.mjs";
|
|
7
|
+
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-xEvVj3lN.mjs";
|
|
8
|
+
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-DHwpIs5e.mjs";
|
|
9
9
|
import { pathToFileURL } from "node:url";
|
|
10
10
|
//#region src/api/dev/dev-engine.ts
|
|
11
11
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
@@ -120,8 +120,11 @@ var DevEngine = class DevEngine {
|
|
|
120
120
|
await this.#inner.registerClient(clientId);
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
* Delivery notification
|
|
124
|
-
*
|
|
123
|
+
* Delivery notification for the payload `filename`. Call it when the client
|
|
124
|
+
* reports that it ran the payload (Vite appends a
|
|
125
|
+
* `__rolldown_runtime__.payloadDelivered(filename)` statement to every patch
|
|
126
|
+
* and lazy chunk). A completed HTTP response is not enough: the bytes may not
|
|
127
|
+
* have evaluated yet. Records the payload's modules as shipped to that client.
|
|
125
128
|
*/
|
|
126
129
|
async notifyPayloadDelivered(filename) {
|
|
127
130
|
await this.#inner.notifyPayloadDelivered(filename);
|
|
@@ -148,7 +151,7 @@ var DevEngine = class DevEngine {
|
|
|
148
151
|
* @param moduleId - The absolute file path of the module to compile
|
|
149
152
|
* @param clientId - The client ID requesting this compilation
|
|
150
153
|
* @returns The compiled chunk: its code plus the filename whose delivery the
|
|
151
|
-
*
|
|
154
|
+
* dev server reports via {@link notifyPayloadDelivered}
|
|
152
155
|
*/
|
|
153
156
|
async compileEntry(moduleId, clientId) {
|
|
154
157
|
return this.#inner.compileEntry(moduleId, clientId);
|
|
@@ -60,12 +60,9 @@ export class DevRuntime {
|
|
|
60
60
|
/**
|
|
61
61
|
* Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
|
|
62
62
|
* scope-hoisted and contributes none.
|
|
63
|
-
* @type {Map<string,
|
|
63
|
+
* @type {Map<string, (id: string) => void>}
|
|
64
64
|
*/
|
|
65
|
-
factories: Map<string,
|
|
66
|
-
kind: "esm" | "cjs";
|
|
67
|
-
fn: (id: string) => void;
|
|
68
|
-
}>;
|
|
65
|
+
factories: Map<string, (id: string) => void>;
|
|
69
66
|
/**
|
|
70
67
|
* Installed by the dev client at boot. The runtime is a store + executor and makes
|
|
71
68
|
* no HMR decisions; accepting, disposing, and reloading live behind these hooks.
|
|
@@ -78,10 +75,9 @@ export class DevRuntime {
|
|
|
78
75
|
registerGraph(delta: ModuleGraphDelta): void;
|
|
79
76
|
/**
|
|
80
77
|
* @param {string} id
|
|
81
|
-
* @param {'esm' | 'cjs'} kind
|
|
82
78
|
* @param {(id: string) => void} fn
|
|
83
79
|
*/
|
|
84
|
-
registerFactory(id: string,
|
|
80
|
+
registerFactory(id: string, fn: (id: string) => void): void;
|
|
85
81
|
/**
|
|
86
82
|
* @param {string} id
|
|
87
83
|
* @param {{ exports: any }} [exportsHolder]
|
|
@@ -118,25 +114,6 @@ export class DevRuntime {
|
|
|
118
114
|
* @param {string} id
|
|
119
115
|
*/
|
|
120
116
|
loadExports(id: string): any;
|
|
121
|
-
/** @type {Map<string, Promise<any>>} */
|
|
122
|
-
lazyRequests: Map<string, Promise<any>>;
|
|
123
|
-
/**
|
|
124
|
-
* The entry point for a lazy `import()`. `id` is the module the boundary stands for; the
|
|
125
|
-
* boundary's own id appears only inside `fetchChunk`'s URL.
|
|
126
|
-
*
|
|
127
|
-
* Nothing is registered under the boundary id, deliberately. A cache entry with no factory
|
|
128
|
-
* behind it reads as "executed" to the HMR boundary walk, and `applyUpdate` turns an
|
|
129
|
-
* updated-but-factory-less module into a full page reload.
|
|
130
|
-
*
|
|
131
|
-
* A rejection is memoized like any other outcome, matching `import()` of a module that
|
|
132
|
-
* threw. Retrying could not work anyway: a factory registers its module before running its
|
|
133
|
-
* body, so re-running `initModule` would return half-initialized exports as success.
|
|
134
|
-
*
|
|
135
|
-
* @param {string} id
|
|
136
|
-
* @param {() => Promise<unknown>} fetchChunk
|
|
137
|
-
* @returns {Promise<any>}
|
|
138
|
-
*/
|
|
139
|
-
requestLazy(id: string, fetchChunk: () => Promise<unknown>): Promise<any>;
|
|
140
117
|
/**
|
|
141
118
|
* @param {string} moduleId
|
|
142
119
|
*/
|
|
@@ -60,12 +60,9 @@ export class DevRuntime {
|
|
|
60
60
|
/**
|
|
61
61
|
* Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
|
|
62
62
|
* scope-hoisted and contributes none.
|
|
63
|
-
* @type {Map<string,
|
|
63
|
+
* @type {Map<string, (id: string) => void>}
|
|
64
64
|
*/
|
|
65
|
-
factories: Map<string,
|
|
66
|
-
kind: "esm" | "cjs";
|
|
67
|
-
fn: (id: string) => void;
|
|
68
|
-
}>;
|
|
65
|
+
factories: Map<string, (id: string) => void>;
|
|
69
66
|
/**
|
|
70
67
|
* Installed by the dev client at boot. The runtime is a store + executor and makes
|
|
71
68
|
* no HMR decisions; accepting, disposing, and reloading live behind these hooks.
|
|
@@ -78,10 +75,9 @@ export class DevRuntime {
|
|
|
78
75
|
registerGraph(delta: ModuleGraphDelta): void;
|
|
79
76
|
/**
|
|
80
77
|
* @param {string} id
|
|
81
|
-
* @param {'esm' | 'cjs'} kind
|
|
82
78
|
* @param {(id: string) => void} fn
|
|
83
79
|
*/
|
|
84
|
-
registerFactory(id: string,
|
|
80
|
+
registerFactory(id: string, fn: (id: string) => void): void;
|
|
85
81
|
/**
|
|
86
82
|
* @param {string} id
|
|
87
83
|
* @param {{ exports: any }} [exportsHolder]
|
|
@@ -118,25 +114,6 @@ export class DevRuntime {
|
|
|
118
114
|
* @param {string} id
|
|
119
115
|
*/
|
|
120
116
|
loadExports(id: string): any;
|
|
121
|
-
/** @type {Map<string, Promise<any>>} */
|
|
122
|
-
lazyRequests: Map<string, Promise<any>>;
|
|
123
|
-
/**
|
|
124
|
-
* The entry point for a lazy `import()`. `id` is the module the boundary stands for; the
|
|
125
|
-
* boundary's own id appears only inside `fetchChunk`'s URL.
|
|
126
|
-
*
|
|
127
|
-
* Nothing is registered under the boundary id, deliberately. A cache entry with no factory
|
|
128
|
-
* behind it reads as "executed" to the HMR boundary walk, and `applyUpdate` turns an
|
|
129
|
-
* updated-but-factory-less module into a full page reload.
|
|
130
|
-
*
|
|
131
|
-
* A rejection is memoized like any other outcome, matching `import()` of a module that
|
|
132
|
-
* threw. Retrying could not work anyway: a factory registers its module before running its
|
|
133
|
-
* body, so re-running `initModule` would return half-initialized exports as success.
|
|
134
|
-
*
|
|
135
|
-
* @param {string} id
|
|
136
|
-
* @param {() => Promise<unknown>} fetchChunk
|
|
137
|
-
* @returns {Promise<any>}
|
|
138
|
-
*/
|
|
139
|
-
requestLazy(id: string, fetchChunk: () => Promise<unknown>): Promise<any>;
|
|
140
117
|
/**
|
|
141
118
|
* @param {string} moduleId
|
|
142
119
|
*/
|
|
@@ -89,7 +89,7 @@ export class DevRuntime {
|
|
|
89
89
|
/**
|
|
90
90
|
* Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
|
|
91
91
|
* scope-hoisted and contributes none.
|
|
92
|
-
* @type {Map<string,
|
|
92
|
+
* @type {Map<string, (id: string) => void>}
|
|
93
93
|
*/
|
|
94
94
|
factories = new Map();
|
|
95
95
|
/**
|
|
@@ -139,11 +139,10 @@ export class DevRuntime {
|
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
141
|
* @param {string} id
|
|
142
|
-
* @param {'esm' | 'cjs'} kind
|
|
143
142
|
* @param {(id: string) => void} fn
|
|
144
143
|
*/
|
|
145
|
-
registerFactory(id,
|
|
146
|
-
this.factories.set(id,
|
|
144
|
+
registerFactory(id, fn) {
|
|
145
|
+
this.factories.set(id, fn);
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
/**
|
|
@@ -192,9 +191,6 @@ export class DevRuntime {
|
|
|
192
191
|
*/
|
|
193
192
|
removeModuleCache(id) {
|
|
194
193
|
this.moduleCache.delete(id);
|
|
195
|
-
// `registerModule` installs a fresh namespace on every run, so a kept memo would hand a
|
|
196
|
-
// later `import()` the pre-edit exports forever.
|
|
197
|
-
this.lazyRequests.delete(id);
|
|
198
194
|
this.hooks?.onModuleCacheRemoval(id);
|
|
199
195
|
}
|
|
200
196
|
|
|
@@ -211,7 +207,7 @@ export class DevRuntime {
|
|
|
211
207
|
if (!factory) {
|
|
212
208
|
throw new MissingFactoryError(id);
|
|
213
209
|
}
|
|
214
|
-
factory
|
|
210
|
+
factory(id);
|
|
215
211
|
return this.loadExports(id);
|
|
216
212
|
}
|
|
217
213
|
|
|
@@ -228,45 +224,6 @@ export class DevRuntime {
|
|
|
228
224
|
}
|
|
229
225
|
}
|
|
230
226
|
|
|
231
|
-
/** @type {Map<string, Promise<any>>} */
|
|
232
|
-
lazyRequests = new Map();
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* The entry point for a lazy `import()`. `id` is the module the boundary stands for; the
|
|
236
|
-
* boundary's own id appears only inside `fetchChunk`'s URL.
|
|
237
|
-
*
|
|
238
|
-
* Nothing is registered under the boundary id, deliberately. A cache entry with no factory
|
|
239
|
-
* behind it reads as "executed" to the HMR boundary walk, and `applyUpdate` turns an
|
|
240
|
-
* updated-but-factory-less module into a full page reload.
|
|
241
|
-
*
|
|
242
|
-
* A rejection is memoized like any other outcome, matching `import()` of a module that
|
|
243
|
-
* threw. Retrying could not work anyway: a factory registers its module before running its
|
|
244
|
-
* body, so re-running `initModule` would return half-initialized exports as success.
|
|
245
|
-
*
|
|
246
|
-
* @param {string} id
|
|
247
|
-
* @param {() => Promise<unknown>} fetchChunk
|
|
248
|
-
* @returns {Promise<any>}
|
|
249
|
-
*/
|
|
250
|
-
requestLazy(id, fetchChunk) {
|
|
251
|
-
const pending = this.lazyRequests.get(id);
|
|
252
|
-
if (pending) {
|
|
253
|
-
return pending;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// Factories outlive `removeModuleCache`, so an evicted module can be re-run without the
|
|
257
|
-
// server — and must be, since the memo went with the cache entry. `Promise.resolve` keeps
|
|
258
|
-
// a synchronous `initModule` throw from escaping the call site.
|
|
259
|
-
const runnableHere = this.moduleCache.has(id) || this.factories.has(id);
|
|
260
|
-
const promise = runnableHere
|
|
261
|
-
? Promise.resolve().then(() => this.initModule(id))
|
|
262
|
-
: Promise.resolve()
|
|
263
|
-
.then(fetchChunk)
|
|
264
|
-
.then(() => this.initModule(id));
|
|
265
|
-
|
|
266
|
-
this.lazyRequests.set(id, promise);
|
|
267
|
-
return promise;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
227
|
/**
|
|
271
228
|
* @param {string} moduleId
|
|
272
229
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as withFilter } from "./shared/define-config-
|
|
1
|
+
import { F as withFilter } from "./shared/define-config-C7HCoqY8.mjs";
|
|
2
2
|
//#region ../../../node_modules/.pnpm/@rolldown+pluginutils@1.0.1/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts
|
|
3
3
|
//#region src/filter/composable-filters.d.ts
|
|
4
4
|
type StringOrRegExp = string | RegExp;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-xuHO4mAy.mjs";
|
|
2
2
|
import { U as PreRenderedChunk } from "./shared/binding-BTa6BPQe.mjs";
|
|
3
|
-
import { A as ResolvedId, At as ChunkFileNamesFunction, B as ExistingRawSourceMap, Bt as MinifyOptions, C as ParallelPluginHooks, Ct as RolldownBuild, D as ResolveFileUrlArgs, Dt as AdvancedChunksGroup, E as PluginMeta, Et as AddonFunction, Ft as CommentsOptions, G as EmittedAsset, Gt as PartialNull, H as OutputBundle, Ht as OutputOptions, It as GeneratedCodeOptions, J as EmittedPrebuiltChunk, Jt as OutputChunk, K as EmittedChunk, L as RUNTIME_MODULE_ID, Lt as GeneratedCodePreset, M as RolldownPluginOption, Mt as CodeSplittingGroup, N as SourceDescription, Nt as CodeSplittingNameFunction, O as ResolveIdExtraOptions, Ot as AdvancedChunksOptions, P as TransformResult, Pt as CodeSplittingOptions, Q as DefineParallelPluginResult, Qt as SourceMap, R as VERSION, Rt as GlobalsFunction, S as ObjectHook, St as rolldown, T as Plugin, Tt as build, U as TreeshakingOptions, Ut as PreRenderedAsset, V as SourceMapInput, Vt as ModuleFormat, W as TransformPluginContext, X as PluginContext, Xt as RenderedModule, Y as GetModuleInfo, Yt as RenderedChunk, Z as PluginContextResolveOptions, Zt as RolldownOutput, _ as HookFilterExtension, _t as watch, a as ChunkOptimizationOptions, at as BufferEncoding, b as ModuleOptions, bt as RolldownWatcherWatcherEventMap, c as InputOption, ct as RolldownFsModule, d as OptimizationOptions, dt as NormalizedInputOptions, en as ModuleInfo, et as MinimalPluginContext, f as WatcherFileWatcherOptions, ft as TransformOptions, g as FunctionPluginHooks, gt as RolldownMagicString, h as CustomPluginOptions, ht as WarningHandlerWithDefault, i as RolldownOptions, it as ModuleTypeFilter, j as RolldownPlugin, jt as ChunkingContext, k as ResolveIdResult, kt as BuiltinModuleTag, l as InputOptions, lt as InternalModuleFormat, m as AsyncPluginHooks, mt as LoggingFunction, n as RolldownOptionsFunction, nt as GeneralHookFilter, o as ExternalOption, ot as RolldownDirectoryEntry, p as WatcherOptions, pt as ChecksOptions, q as EmittedFile, qt as OutputAsset, r as defineConfig, rt as HookFilter, s as ExternalOptionFunction, st as RolldownFileStats, t as ConfigExport, tn as SourcemapIgnoreListOption, tt as PluginContextMeta, u as ModuleTypes, ut as NormalizedOutputOptions, v as ImportKind, vt as RolldownWatcher, w as PartialResolvedId, wt as BuildOptions, x as ModuleType, xt as WatchOptions, y as LoadResult, yt as RolldownWatcherEvent, z as BundleError, zt as ManglePropertiesOptions } from "./shared/define-config-
|
|
3
|
+
import { A as ResolvedId, At as ChunkFileNamesFunction, B as ExistingRawSourceMap, Bt as MinifyOptions, C as ParallelPluginHooks, Ct as RolldownBuild, D as ResolveFileUrlArgs, Dt as AdvancedChunksGroup, E as PluginMeta, Et as AddonFunction, Ft as CommentsOptions, G as EmittedAsset, Gt as PartialNull, H as OutputBundle, Ht as OutputOptions, It as GeneratedCodeOptions, J as EmittedPrebuiltChunk, Jt as OutputChunk, K as EmittedChunk, L as RUNTIME_MODULE_ID, Lt as GeneratedCodePreset, M as RolldownPluginOption, Mt as CodeSplittingGroup, N as SourceDescription, Nt as CodeSplittingNameFunction, O as ResolveIdExtraOptions, Ot as AdvancedChunksOptions, P as TransformResult, Pt as CodeSplittingOptions, Q as DefineParallelPluginResult, Qt as SourceMap, R as VERSION, Rt as GlobalsFunction, S as ObjectHook, St as rolldown, T as Plugin, Tt as build, U as TreeshakingOptions, Ut as PreRenderedAsset, V as SourceMapInput, Vt as ModuleFormat, W as TransformPluginContext, X as PluginContext, Xt as RenderedModule, Y as GetModuleInfo, Yt as RenderedChunk, Z as PluginContextResolveOptions, Zt as RolldownOutput, _ as HookFilterExtension, _t as watch, a as ChunkOptimizationOptions, at as BufferEncoding, b as ModuleOptions, bt as RolldownWatcherWatcherEventMap, c as InputOption, ct as RolldownFsModule, d as OptimizationOptions, dt as NormalizedInputOptions, en as ModuleInfo, et as MinimalPluginContext, f as WatcherFileWatcherOptions, ft as TransformOptions, g as FunctionPluginHooks, gt as RolldownMagicString, h as CustomPluginOptions, ht as WarningHandlerWithDefault, i as RolldownOptions, it as ModuleTypeFilter, j as RolldownPlugin, jt as ChunkingContext, k as ResolveIdResult, kt as BuiltinModuleTag, l as InputOptions, lt as InternalModuleFormat, m as AsyncPluginHooks, mt as LoggingFunction, n as RolldownOptionsFunction, nt as GeneralHookFilter, o as ExternalOption, ot as RolldownDirectoryEntry, p as WatcherOptions, pt as ChecksOptions, q as EmittedFile, qt as OutputAsset, r as defineConfig, rt as HookFilter, s as ExternalOptionFunction, st as RolldownFileStats, t as ConfigExport, tn as SourcemapIgnoreListOption, tt as PluginContextMeta, u as ModuleTypes, ut as NormalizedOutputOptions, v as ImportKind, vt as RolldownWatcher, w as PartialResolvedId, wt as BuildOptions, x as ModuleType, xt as WatchOptions, y as LoadResult, yt as RolldownWatcherEvent, z as BundleError, zt as ManglePropertiesOptions } from "./shared/define-config-C7HCoqY8.mjs";
|
|
4
4
|
export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, type ManglePropertiesOptions, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PluginContextResolveOptions, type PluginMeta, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveFileUrlArgs, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/rolldown/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
3
|
-
import { T as VERSION, s as RolldownMagicString } from "./shared/bindingify-input-options-
|
|
4
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-BY0qR5iS.mjs";
|
|
2
|
+
import { n as onExit, t as watch } from "./shared/watch-RXhXN1aG.mjs";
|
|
3
|
+
import { T as VERSION, s as RolldownMagicString } from "./shared/bindingify-input-options-B8JHmN6_.mjs";
|
|
4
|
+
import { t as rolldown } from "./shared/rolldown-Bue0gNT5.mjs";
|
|
5
5
|
import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
|
|
6
6
|
import { isMainThread } from "node:worker_threads";
|
|
7
7
|
//#region src/setup.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import { c as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-BY0qR5iS.mjs";
|
|
2
|
+
import { c as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-B8JHmN6_.mjs";
|
|
3
3
|
import { parentPort, workerData } from "node:worker_threads";
|
|
4
4
|
//#region src/parallel-plugin-worker.ts
|
|
5
5
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as Plugin, Wt as MaybePromise } from "./shared/define-config-
|
|
1
|
+
import { T as Plugin, Wt as MaybePromise } from "./shared/define-config-C7HCoqY8.mjs";
|
|
2
2
|
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
3
3
|
type ParallelPluginImplementation = Plugin;
|
|
4
4
|
type Context = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as parseSync, t as parse } from "./shared/parse-
|
|
1
|
+
import { d as locate, f as getCodeFrame, l as logParseError, n as error, t as augmentCodeLocation } from "./shared/logs-D6uA606S.mjs";
|
|
2
|
+
import { n as parseSync, t as parse } from "./shared/parse-BWeE7Vr9.mjs";
|
|
3
3
|
//#region src/parse-ast-index.ts
|
|
4
4
|
function wrap(result, filename, sourceText) {
|
|
5
5
|
if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as BindingReplacePluginConfig } from "./shared/binding-BTa6BPQe.mjs";
|
|
2
|
-
import { I as BuiltinPlugin } from "./shared/define-config-
|
|
3
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
2
|
+
import { I as BuiltinPlugin } from "./shared/define-config-C7HCoqY8.mjs";
|
|
3
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-DuOq7MqW.mjs";
|
|
4
4
|
//#region src/builtin-plugin/replace-plugin.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Replaces targeted strings in files while bundling.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-
|
|
2
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-F14uvr6D.mjs";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-xEvVj3lN.mjs";
|
|
3
3
|
//#region src/builtin-plugin/replace-plugin.ts
|
|
4
4
|
/**
|
|
5
5
|
* Replaces targeted strings in files while bundling.
|