-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
htmlSuffix 会生成 xxx.html,非xxx/index.html dynamicRoot可不用做任何修改部署在任意目录下
- Loading branch information
Showing
10 changed files
with
238 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default { | ||
runtimePublicPath: {}, | ||
exportStatic: { | ||
htmlSuffix: true, | ||
dynamicRoot: true, | ||
}, | ||
hash: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "@example/export-static", | ||
"private": true, | ||
"scripts": { | ||
"build": "umi build", | ||
"dev": "umi dev", | ||
"setup": "umi setup", | ||
"start": "npm run dev" | ||
}, | ||
"dependencies": { | ||
"umi": "workspace:*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
|
||
export default function Page1() { | ||
return <h1>404</h1>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.bar { | ||
background: green; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
.foo { | ||
color: red; | ||
} | ||
.foo2 { | ||
font-size: 40px; | ||
} | ||
.foo3 { | ||
font-weight: bold; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
// @ts-ignore | ||
import { Helmet, Link } from 'umi'; | ||
// @ts-ignore | ||
import fooStyles from './foo.less'; | ||
// @ts-ignore | ||
import barStyles from './bar.css'; | ||
|
||
export default function HomePage() { | ||
return ( | ||
<div> | ||
<Helmet> | ||
<title>helmet title</title> | ||
</Helmet> | ||
<div | ||
className={`${fooStyles.foo} ${fooStyles.foo2} ${fooStyles.foo3} ${barStyles.bar}`} | ||
> | ||
Home Page | ||
</div> | ||
<Link to="/page1"> | ||
<h2>Page 1(/page1)</h2> | ||
</Link> | ||
<Link to="/page1.html"> | ||
<h2>Page 1(/page1.html)</h2> | ||
</Link> | ||
<Link to="/page1/page1_1"> | ||
<h2>Page 1-1(/page1/page1_1)</h2> | ||
</Link> | ||
<Link to="/page1/page1_1.html"> | ||
<h2>Page 1-1(/page1/page1_1.html)</h2> | ||
</Link> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
|
||
export default function Page1() { | ||
return <h1>Page 1</h1>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from 'react'; | ||
|
||
export default function Page1() { | ||
return <h1>Page 1-1</h1>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.