[ci] format

This commit is contained in:
matthewp 2022-04-22 14:04:54 +00:00 committed by github-actions[bot]
parent bd76716c88
commit 738fb958c3
4 changed files with 12 additions and 11 deletions

View file

@ -74,12 +74,10 @@ if(_start in adapter) {
const manifest = buildManifest(buildOpts, internals, staticFiles);
for (const [_chunkName, chunk] of Object.entries(bundle)) {
if (chunk.type === 'asset') {
continue;
};
}
if (chunk.modules[resolvedVirtualModuleId]) {
const code = chunk.code;
chunk.code = code.replace(replaceExp, () => {
@ -91,7 +89,11 @@ if(_start in adapter) {
};
}
function buildManifest(opts: StaticBuildOptions, internals: BuildInternals, staticFiles: string[]): SerializedSSRManifest {
function buildManifest(
opts: StaticBuildOptions,
internals: BuildInternals,
staticFiles: string[]
): SerializedSSRManifest {
const { astroConfig } = opts;
const routes: SerializedRouteInfo[] = [];
@ -122,7 +124,7 @@ function buildManifest(opts: StaticBuildOptions, internals: BuildInternals, stat
pageMap: null as any,
renderers: [],
entryModules,
assets: staticFiles.map(s => '/' + s)
assets: staticFiles.map((s) => '/' + s),
};
return ssrManifest;

View file

@ -10,7 +10,7 @@ export function createExports(manifest: SSRManifest) {
// If this matches a static asset, just return and Netlify will forward it
// to its static asset handler.
if(manifest.assets.has(url.pathname)) {
if (manifest.assets.has(url.pathname)) {
return;
}
if (app.match(request)) {

View file

@ -8,7 +8,9 @@ Deno.test({
name: 'Assets are preferred over HTML routes',
async fn() {
let close = await runBuild('./fixtures/root-dynamic/');
const { default: handler } = await import('./fixtures/root-dynamic/dist/edge-functions/entry.js');
const { default: handler } = await import(
'./fixtures/root-dynamic/dist/edge-functions/entry.js'
);
const response = await handler(new Request('http://example.com/styles.css'));
assertEquals(response, undefined, 'No response because this is an asset');
await close();

View file

@ -6,9 +6,6 @@
"module": "ES2020",
"outDir": "./dist",
"target": "ES2020",
"typeRoots": [
"node_modules/@types",
"node_modules/@netlify"
]
"typeRoots": ["node_modules/@types", "node_modules/@netlify"]
}
}