Skip to content

Commit

Permalink
Merge branch 'main' into feat-sandpack-template
Browse files Browse the repository at this point in the history
  • Loading branch information
caohuilin committed Sep 5, 2023
2 parents 10e9fac + 7d70738 commit b91c928
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/dull-bees-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/prod-server': patch
'@modern-js/server-core': patch
---

fix: some link shouldn't have as attributes
fix: 一些 link 头不应该添加 as 属性
2 changes: 1 addition & 1 deletion packages/server/core/src/types/config/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Route =
export type Routes = Record<string, Route>;

type PreloadInclude = Array<
string | { url: string; type: string; rel?: string }
string | { url: string; type?: string; rel?: string }
>;
interface PreloadAttributes {
script?: Record<string, boolean | string>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports[`test preload test flushServerHeader 1`] = `
"<style1.css>; rel=preload; as=style; id=css_link_id",
"<style2.css>; rel=preload; as=style; id=css_link_id",
"<http://example.com>; rel=preload; as=script; crossorigin; id=script_id",
"<http://example3.com>; rel=dns-prefetch; as=script; crossorigin; id=script_id",
"<http://example3.com>; rel=dns-prefetch",
],
},
{
Expand Down
1 change: 0 additions & 1 deletion packages/server/prod-server/tests/preload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ describe('test preload', () => {
{ url: 'http://example.com', type: 'script' },
{
url: 'http://example3.com',
type: 'script',
rel: 'dns-prefetch',
},
'/static/js/async/three_user/layout.js',
Expand Down

0 comments on commit b91c928

Please sign in to comment.