vite-plugin-zephyr 1.2.0 → 1.2.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.
|
@@ -9,8 +9,7 @@ function getScriptBaseUrl() {
|
|
|
9
9
|
const src = document.currentScript.src;
|
|
10
10
|
if (src) {
|
|
11
11
|
const url = new URL(src);
|
|
12
|
-
|
|
13
|
-
return routeBase ? `${url.origin}${routeBase[0]}` : url.origin;
|
|
12
|
+
return `${url.protocol}//${url.host}`;
|
|
14
13
|
}
|
|
15
14
|
} catch {}
|
|
16
15
|
return '';
|
|
@@ -69,9 +69,6 @@ var __webpack_exports__ = {};
|
|
|
69
69
|
const partial_build_scope_js_namespaceObject = require("./internal/partial-build-scope.js");
|
|
70
70
|
const DEFAULT_LIBRARY_TYPE = 'module';
|
|
71
71
|
const VITE_ENVIRONMENT_OUTPUT_PREFIX = 'vite-environment:';
|
|
72
|
-
function isOriginAbsoluteBase(base) {
|
|
73
|
-
return 'string' == typeof base && base.startsWith('/') && !base.startsWith('//');
|
|
74
|
-
}
|
|
75
72
|
function mergeClaimedPartialMaps(claims) {
|
|
76
73
|
const merged = {};
|
|
77
74
|
for (const claim of claims)for (const [partialKey, assetsMap] of Object.entries(claim.partialAssetMaps)){
|
|
@@ -274,11 +271,9 @@ var __webpack_exports__ = {};
|
|
|
274
271
|
return {
|
|
275
272
|
name: 'with-zephyr',
|
|
276
273
|
enforce: 'pre',
|
|
277
|
-
config: (config
|
|
274
|
+
config: (config)=>{
|
|
278
275
|
registerModuleFederationConfigs((0, extract_mf_plugin_js_namespaceObject.extract_mf_plugins)(config.plugins ?? []).map((plugin)=>plugin._options));
|
|
279
|
-
return
|
|
280
|
-
base: './'
|
|
281
|
-
};
|
|
276
|
+
return null;
|
|
282
277
|
},
|
|
283
278
|
configResolved: async (config)=>{
|
|
284
279
|
const vite = await import("vite");
|
|
@@ -305,12 +300,6 @@ var __webpack_exports__ = {};
|
|
|
305
300
|
context: root,
|
|
306
301
|
target: options.target
|
|
307
302
|
});
|
|
308
|
-
try {
|
|
309
|
-
const zephyrEngine = await zephyr_engine_defer;
|
|
310
|
-
if ((0, external_zephyr_agent_namespaceObject.usesPathAddressing)(await zephyrEngine.application_configuration) && isOriginAbsoluteBase(config.base)) external_zephyr_agent_namespaceObject.ze_log.init(`The resolved Vite base '${config.base}' is still origin-absolute for a path-addressed target. A later config hook may have overridden Zephyr's relative base.`);
|
|
311
|
-
} catch (error) {
|
|
312
|
-
(0, external_zephyr_agent_namespaceObject.handleGlobalError)(error);
|
|
313
|
-
}
|
|
314
303
|
resolve_vite_internal_options({
|
|
315
304
|
root,
|
|
316
305
|
outDir: config.build?.outDir,
|
|
@@ -2,7 +2,7 @@ import "node:module";
|
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import magic_string from "magic-string";
|
|
5
|
-
import { ApplicationContext, ZeErrors, ZephyrEngine, ZephyrError, assertTapFederationPublicationMetadata, assertZephyrBuildTarget, claimPartialAssetMapBatch, commitPartialAssetMapClaimBatch, createManifestContent, handleGlobalError, normalizeBasePath, rewriteEnvReadsToVirtualModule, rollbackPartialAssetMapClaimBatch, savePartialAssetMap,
|
|
5
|
+
import { ApplicationContext, ZeErrors, ZephyrEngine, ZephyrError, assertTapFederationPublicationMetadata, assertZephyrBuildTarget, claimPartialAssetMapBatch, commitPartialAssetMapClaimBatch, createManifestContent, handleGlobalError, normalizeBasePath, rewriteEnvReadsToVirtualModule, rollbackPartialAssetMapClaimBatch, savePartialAssetMap, zeBuildAssets, zeBuildDashData, ze_log } from "zephyr-agent";
|
|
6
6
|
import { extractEntrypoint } from "./internal/extract/extract-entrypoint.mjs";
|
|
7
7
|
import { extract_mf_plugins } from "./internal/extract/extract_mf_plugin.mjs";
|
|
8
8
|
import { extract_vite_assets_map } from "./internal/extract/extract_vite_assets_map.mjs";
|
|
@@ -20,9 +20,6 @@ __webpack_require__.add({
|
|
|
20
20
|
});
|
|
21
21
|
const DEFAULT_LIBRARY_TYPE = 'module';
|
|
22
22
|
const VITE_ENVIRONMENT_OUTPUT_PREFIX = 'vite-environment:';
|
|
23
|
-
function isOriginAbsoluteBase(base) {
|
|
24
|
-
return 'string' == typeof base && base.startsWith('/') && !base.startsWith('//');
|
|
25
|
-
}
|
|
26
23
|
function mergeClaimedPartialMaps(claims) {
|
|
27
24
|
const merged = {};
|
|
28
25
|
for (const claim of claims)for (const [partialKey, assetsMap] of Object.entries(claim.partialAssetMaps)){
|
|
@@ -225,11 +222,9 @@ function withZephyrCore(options = {}) {
|
|
|
225
222
|
return {
|
|
226
223
|
name: 'with-zephyr',
|
|
227
224
|
enforce: 'pre',
|
|
228
|
-
config: (config
|
|
225
|
+
config: (config)=>{
|
|
229
226
|
registerModuleFederationConfigs(extract_mf_plugins(config.plugins ?? []).map((plugin)=>plugin._options));
|
|
230
|
-
return
|
|
231
|
-
base: './'
|
|
232
|
-
};
|
|
227
|
+
return null;
|
|
233
228
|
},
|
|
234
229
|
configResolved: async (config)=>{
|
|
235
230
|
const vite = await import("vite");
|
|
@@ -256,12 +251,6 @@ function withZephyrCore(options = {}) {
|
|
|
256
251
|
context: root,
|
|
257
252
|
target: options.target
|
|
258
253
|
});
|
|
259
|
-
try {
|
|
260
|
-
const zephyrEngine = await zephyr_engine_defer;
|
|
261
|
-
if (usesPathAddressing(await zephyrEngine.application_configuration) && isOriginAbsoluteBase(config.base)) ze_log.init(`The resolved Vite base '${config.base}' is still origin-absolute for a path-addressed target. A later config hook may have overridden Zephyr's relative base.`);
|
|
262
|
-
} catch (error) {
|
|
263
|
-
handleGlobalError(error);
|
|
264
|
-
}
|
|
265
254
|
resolve_vite_internal_options({
|
|
266
255
|
root,
|
|
267
256
|
outDir: config.build?.outDir,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/vitejs/vite-plugin-registry/refs/heads/main/data/schema/extended-package-json.schema.json",
|
|
3
3
|
"name": "vite-plugin-zephyr",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"description": "Vite plugin for Zephyr",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"deploy",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"acorn": "^8.17.0",
|
|
52
52
|
"acorn-walk": "^8.3.5",
|
|
53
53
|
"magic-string": "0.30.21",
|
|
54
|
-
"zephyr-agent": "1.2.
|
|
54
|
+
"zephyr-agent": "1.2.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@module-federation/vite": "1.16.15",
|