0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

[ci] yarn format

This commit is contained in:
natemoo-re 2022-02-25 23:04:58 +00:00 committed by GitHub Actions
parent fca6407318
commit a5a1563094
2 changed files with 6 additions and 12 deletions

View file

@ -78,10 +78,7 @@ export async function createVite(inlineConfig: ViteConfigWithSSR, { astroConfig,
// Note: SSR API is in beta (https://vitejs.dev/guide/ssr.html)
ssr: {
external: [...ALWAYS_EXTERNAL],
noExternal: [
...ALWAYS_NOEXTERNAL,
...astroPackages
],
noExternal: [...ALWAYS_NOEXTERNAL, ...astroPackages],
},
};
@ -156,7 +153,7 @@ const COMMON_DEPENDENCIES_NOT_ASTRO = [
'astro',
'tslib',
'typescript',
'vite'
'vite',
];
const COMMON_PREFIXES_NOT_ASTRO = [
@ -174,17 +171,14 @@ const COMMON_PREFIXES_NOT_ASTRO = [
'remark-',
'rehype-',
'rollup-plugin-',
'vite-plugin-'
'vite-plugin-',
];
function isCommonNotAstro(dep: string): boolean {
return (
COMMON_DEPENDENCIES_NOT_ASTRO.includes(dep) ||
COMMON_PREFIXES_NOT_ASTRO.some(
(prefix) =>
prefix.startsWith('@')
? dep.startsWith(prefix)
: dep.substring(dep.lastIndexOf('/') + 1).startsWith(prefix) // check prefix omitting @scope/
(prefix) => (prefix.startsWith('@') ? dep.startsWith(prefix) : dep.substring(dep.lastIndexOf('/') + 1).startsWith(prefix)) // check prefix omitting @scope/
)
);
}