diff options
author | 2022-09-09 14:56:07 +0000 | |
---|---|---|
committer | 2022-09-09 14:56:07 +0000 | |
commit | e5fd0a49469cee406d68be65bc97b8a7f2bb3b88 (patch) | |
tree | a2d0b137c0c3aef752b67a6357dbf34ed1fe7c03 | |
parent | f27ca6ab3edbf0ef55e213ffd09aac454ce07995 (diff) | |
download | astro-e5fd0a49469cee406d68be65bc97b8a7f2bb3b88.tar.gz astro-e5fd0a49469cee406d68be65bc97b8a7f2bb3b88.tar.zst astro-e5fd0a49469cee406d68be65bc97b8a7f2bb3b88.zip |
[ci] format
-rw-r--r-- | packages/astro/src/vite-plugin-astro/index.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index b132afe1b..d946dd256 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -9,9 +9,9 @@ import ancestor from 'common-ancestor-path'; import esbuild from 'esbuild'; import slash from 'slash'; import { fileURLToPath } from 'url'; +import { cachedCompilation, CompileProps, getCachedSource } from '../core/compile/index.js'; import { isRelativePath, prependForwardSlash, startsWithForwardSlash } from '../core/path.js'; import { viteID } from '../core/util.js'; -import { cachedCompilation, CompileProps, getCachedSource } from '../core/compile/index.js'; import { getFileInfo } from '../vite-plugin-utils/index.js'; import { createTransformStyles, @@ -49,7 +49,8 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu // Variables for determining if an id starts with /src... const srcRootWeb = config.srcDir.pathname.slice(config.root.pathname.length - 1); const isBrowserPath = (path: string) => path.startsWith(srcRootWeb); - const isFullFilePath = (path: string) => path.startsWith(prependForwardSlash(slash(fileURLToPath(config.root)))); + const isFullFilePath = (path: string) => + path.startsWith(prependForwardSlash(slash(fileURLToPath(config.root)))); function resolveRelativeFromAstroParent(id: string, parsedFrom: ParsedRequestResult): string { const filename = normalizeFilename(parsedFrom.filename); @@ -97,7 +98,7 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu return relativeToRoot(id); } // Convert file paths to ViteID, meaning on Windows it omits the leading slash - if(isFullFilePath(id)) { + if (isFullFilePath(id)) { return viteID(new URL('file://' + id)); } return id; |