[ci] format
This commit is contained in:
parent
7e5ac1f45c
commit
f9e8e72a48
4 changed files with 9 additions and 12 deletions
|
@ -1,6 +1,5 @@
|
||||||
import type { PluginContext } from 'rollup';
|
import type { PluginContext } from 'rollup';
|
||||||
import type { Plugin as VitePlugin } from 'vite';
|
import type { Plugin as VitePlugin } from 'vite';
|
||||||
import type { AstroConfig } from '../../@types/astro';
|
|
||||||
import type { BuildInternals } from '../../core/build/internal.js';
|
import type { BuildInternals } from '../../core/build/internal.js';
|
||||||
import type { PluginMetadata as AstroPluginMetadata } from '../../vite-plugin-astro/types';
|
import type { PluginMetadata as AstroPluginMetadata } from '../../vite-plugin-astro/types';
|
||||||
|
|
||||||
|
@ -9,9 +8,7 @@ import { resolveClientDevPath } from '../../core/render/dev/resolve.js';
|
||||||
import { getTopLevelPages } from './graph.js';
|
import { getTopLevelPages } from './graph.js';
|
||||||
import { getPageDataByViteID, trackClientOnlyPageDatas } from './internal.js';
|
import { getPageDataByViteID, trackClientOnlyPageDatas } from './internal.js';
|
||||||
|
|
||||||
export function vitePluginAnalyzer(
|
export function vitePluginAnalyzer(internals: BuildInternals): VitePlugin {
|
||||||
internals: BuildInternals
|
|
||||||
): VitePlugin {
|
|
||||||
function hoistedScriptScanner() {
|
function hoistedScriptScanner() {
|
||||||
const uniqueHoistedIds = new Map<string, string>();
|
const uniqueHoistedIds = new Map<string, string>();
|
||||||
const pageScripts = new Map<string, Set<string>>();
|
const pageScripts = new Map<string, Set<string>>();
|
||||||
|
|
|
@ -145,9 +145,9 @@ function buildManifest(
|
||||||
|
|
||||||
// HACK! Patch this special one.
|
// HACK! Patch this special one.
|
||||||
const entryModules = Object.fromEntries(internals.entrySpecifierToBundleMap.entries());
|
const entryModules = Object.fromEntries(internals.entrySpecifierToBundleMap.entries());
|
||||||
if(!(BEFORE_HYDRATION_SCRIPT_ID in entryModules)) {
|
if (!(BEFORE_HYDRATION_SCRIPT_ID in entryModules)) {
|
||||||
entryModules[BEFORE_HYDRATION_SCRIPT_ID] =
|
entryModules[BEFORE_HYDRATION_SCRIPT_ID] =
|
||||||
'data:text/javascript;charset=utf-8,//[no before-hydration script]';
|
'data:text/javascript;charset=utf-8,//[no before-hydration script]';
|
||||||
}
|
}
|
||||||
|
|
||||||
const ssrManifest: SerializedSSRManifest = {
|
const ssrManifest: SerializedSSRManifest = {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Plugin as VitePlugin, ConfigEnv } from 'vite';
|
import { ConfigEnv, Plugin as VitePlugin } from 'vite';
|
||||||
import { AstroConfig, InjectedScriptStage } from '../@types/astro.js';
|
import { AstroConfig, InjectedScriptStage } from '../@types/astro.js';
|
||||||
|
|
||||||
// NOTE: We can't use the virtual "\0" ID convention because we need to
|
// NOTE: We can't use the virtual "\0" ID convention because we need to
|
||||||
|
@ -57,6 +57,6 @@ export default function astroScriptsPlugin({ config }: { config: AstroConfig }):
|
||||||
name: BEFORE_HYDRATION_SCRIPT_ID,
|
name: BEFORE_HYDRATION_SCRIPT_ID,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue