diff options
author | 2022-05-19 15:50:10 +0000 | |
---|---|---|
committer | 2022-05-19 15:50:10 +0000 | |
commit | e9c137cf5f25199d7c9368b24d63947f3cef22cc (patch) | |
tree | d8db8e6f05fe7820633ab736275dbdcc902c2e6b | |
parent | d34859d75008812fcd101e197ce835bcc1ee2017 (diff) | |
download | astro-e9c137cf5f25199d7c9368b24d63947f3cef22cc.tar.gz astro-e9c137cf5f25199d7c9368b24d63947f3cef22cc.tar.zst astro-e9c137cf5f25199d7c9368b24d63947f3cef22cc.zip |
[ci] format
-rw-r--r-- | packages/astro/src/vite-plugin-astro/index.ts | 4 | ||||
-rw-r--r-- | packages/astro/src/vite-plugin-utils/index.ts | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index 4589adce5..4be0472cb 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -182,7 +182,9 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu }); 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. if (!resolvedConfig.isProduction) { // HACK: extract dependencies from metadata until compiler static extraction handles them diff --git a/packages/astro/src/vite-plugin-utils/index.ts b/packages/astro/src/vite-plugin-utils/index.ts index d6ccd58b0..32d896e15 100644 --- a/packages/astro/src/vite-plugin-utils/index.ts +++ b/packages/astro/src/vite-plugin-utils/index.ts @@ -8,8 +8,8 @@ export function getFileInfo(id: string, config: AstroConfig) { const fileId = id.split('?')[0]; let fileUrl = fileId.includes('/pages/') - ? fileId.replace(/^.*?\/pages\//, sitePathname).replace(/(\/index)?\.(md|astro)$/, '') - : undefined; + ? fileId.replace(/^.*?\/pages\//, sitePathname).replace(/(\/index)?\.(md|astro)$/, '') + : undefined; if (fileUrl && config.trailingSlash === 'always') { fileUrl = appendForwardSlash(fileUrl); } |