Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and github-actions[bot] committed Apr 22, 2022
1 parent bd76716 commit 738fb95
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
12 changes: 7 additions & 5 deletions packages/astro/src/core/build/vite-plugin-ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {
Expand All @@ -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[] = [];
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 1 addition & 4 deletions packages/integrations/netlify/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"module": "ES2020",
"outDir": "./dist",
"target": "ES2020",
"typeRoots": [
"node_modules/@types",
"node_modules/@netlify"
]
"typeRoots": ["node_modules/@types", "node_modules/@netlify"]
}
}

0 comments on commit 738fb95

Please sign in to comment.