0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

[ci] format

This commit is contained in:
matthewp 2022-06-06 16:03:17 +00:00 committed by github-actions[bot]
parent c22a07db13
commit 8bb28b48ee
2 changed files with 7 additions and 7 deletions

View file

@ -62,17 +62,18 @@ export default function createIntegration(args?: Options): AstroIntegration {
allowOverwrite: true, allowOverwrite: true,
format: 'esm', format: 'esm',
bundle: true, bundle: true,
external: [ "@astrojs/markdown-remark"] external: ['@astrojs/markdown-remark'],
}); });
// Remove chunks, if they exist. Since we have bundled via esbuild these chunks are trash. // Remove chunks, if they exist. Since we have bundled via esbuild these chunks are trash.
try { try {
const chunkFileNames = _vite?.build?.rollupOptions?.output?.chunkFileNames ?? 'chunks/chunk.[hash].mjs'; const chunkFileNames =
_vite?.build?.rollupOptions?.output?.chunkFileNames ?? 'chunks/chunk.[hash].mjs';
const chunkPath = npath.dirname(chunkFileNames); const chunkPath = npath.dirname(chunkFileNames);
const chunksDirUrl = new URL(chunkPath + '/', _buildConfig.server); const chunksDirUrl = new URL(chunkPath + '/', _buildConfig.server);
await fs.promises.rm(chunksDirUrl, { recursive: true, force: true }); await fs.promises.rm(chunksDirUrl, { recursive: true, force: true });
} catch {} } catch {}
} },
}, },
}; };
} }

View file

@ -26,13 +26,13 @@ export async function startModFromSubprocess(baseUrl) {
let proc = Deno.run({ let proc = Deno.run({
cmd: ['deno', 'run', '--allow-env', '--allow-net', fromFileUrl(entryUrl)], cmd: ['deno', 'run', '--allow-env', '--allow-net', fromFileUrl(entryUrl)],
cwd: fromFileUrl(baseUrl), cwd: fromFileUrl(baseUrl),
stderr: 'piped' stderr: 'piped',
}); });
const stderr = readableStreamFromReader(proc.stderr); const stderr = readableStreamFromReader(proc.stderr);
const dec = new TextDecoder(); const dec = new TextDecoder();
for await(let bytes of stderr) { for await (let bytes of stderr) {
let msg = dec.decode(bytes); let msg = dec.decode(bytes);
if(msg.includes(`Server running`)) { if (msg.includes(`Server running`)) {
break; break;
} }
} }
@ -49,7 +49,6 @@ export async function runBuildAndStartApp(fixturePath, cb) {
await close(); await close();
} }
export async function runBuildAndStartAppFromSubprocess(fixturePath, cb) { export async function runBuildAndStartAppFromSubprocess(fixturePath, cb) {
const url = new URL(fixturePath, dir); const url = new URL(fixturePath, dir);
const close = await runBuild(fixturePath); const close = await runBuild(fixturePath);