[ci] format
This commit is contained in:
parent
85b905495d
commit
ff6c9490a0
1 changed files with 6 additions and 4 deletions
|
@ -37,18 +37,20 @@ export default async function dev(config: AstroConfig, options: DevOptions): Pro
|
||||||
const { host, port } = config.server;
|
const { host, port } = config.server;
|
||||||
|
|
||||||
// load client runtime scripts ahead-of-time to fix "isSelfAccepting" bug during HMR
|
// load client runtime scripts ahead-of-time to fix "isSelfAccepting" bug during HMR
|
||||||
const clientRuntimeScripts = await glob(new URL('../../runtime/client/*.js', import.meta.url).pathname);
|
const clientRuntimeScripts = await glob(
|
||||||
|
new URL('../../runtime/client/*.js', import.meta.url).pathname
|
||||||
|
);
|
||||||
const clientRuntimeFilePaths = clientRuntimeScripts
|
const clientRuntimeFilePaths = clientRuntimeScripts
|
||||||
.map(script => `astro/client/${path.basename(script)}`)
|
.map((script) => `astro/client/${path.basename(script)}`)
|
||||||
// fixes duplicate dependency issue in monorepo when using astro: "workspace:*"
|
// fixes duplicate dependency issue in monorepo when using astro: "workspace:*"
|
||||||
.filter(filePath => filePath !== 'astro/client/hmr.js');
|
.filter((filePath) => filePath !== 'astro/client/hmr.js');
|
||||||
const viteConfig = await createVite(
|
const viteConfig = await createVite(
|
||||||
{
|
{
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
server: { host },
|
server: { host },
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
include: clientRuntimeFilePaths,
|
include: clientRuntimeFilePaths,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{ astroConfig: config, logging: options.logging, mode: 'dev' }
|
{ astroConfig: config, logging: options.logging, mode: 'dev' }
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue