[ci] format
This commit is contained in:
parent
d34859d750
commit
e9c137cf5f
2 changed files with 5 additions and 3 deletions
|
@ -182,7 +182,9 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu
|
||||||
});
|
});
|
||||||
|
|
||||||
let SUFFIX = '';
|
let SUFFIX = '';
|
||||||
SUFFIX += `\nconst $$file = ${JSON.stringify(file)};\nconst $$url = ${JSON.stringify(url)};export { $$file as file, $$url as url };\n`;
|
SUFFIX += `\nconst $$file = ${JSON.stringify(file)};\nconst $$url = ${JSON.stringify(
|
||||||
|
url
|
||||||
|
)};export { $$file as file, $$url as url };\n`;
|
||||||
// Add HMR handling in dev mode.
|
// Add HMR handling in dev mode.
|
||||||
if (!resolvedConfig.isProduction) {
|
if (!resolvedConfig.isProduction) {
|
||||||
// HACK: extract dependencies from metadata until compiler static extraction handles them
|
// HACK: extract dependencies from metadata until compiler static extraction handles them
|
||||||
|
|
|
@ -8,8 +8,8 @@ export function getFileInfo(id: string, config: AstroConfig) {
|
||||||
|
|
||||||
const fileId = id.split('?')[0];
|
const fileId = id.split('?')[0];
|
||||||
let fileUrl = fileId.includes('/pages/')
|
let fileUrl = fileId.includes('/pages/')
|
||||||
? fileId.replace(/^.*?\/pages\//, sitePathname).replace(/(\/index)?\.(md|astro)$/, '')
|
? fileId.replace(/^.*?\/pages\//, sitePathname).replace(/(\/index)?\.(md|astro)$/, '')
|
||||||
: undefined;
|
: undefined;
|
||||||
if (fileUrl && config.trailingSlash === 'always') {
|
if (fileUrl && config.trailingSlash === 'always') {
|
||||||
fileUrl = appendForwardSlash(fileUrl);
|
fileUrl = appendForwardSlash(fileUrl);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue