gh-pages 调整

This commit is contained in:
liaoxuezhi 2019-05-09 19:40:59 +08:00
parent 7c23a5bc1c
commit 1bb2fead90
5 changed files with 15 additions and 16150 deletions

View File

@ -82,6 +82,10 @@ import Button from '../../src/components/Button';
let PathPrefix = '/examples'; let PathPrefix = '/examples';
if (process.env.NODE_ENV === 'production') {
PathPrefix = ''
}
const navigations = [ const navigations = [
{ {
label: '示例', label: '示例',
@ -690,7 +694,7 @@ export class App extends React.PureComponent {
} }
} }
function navigations2route(pathPrefix = '/examples') { function navigations2route(pathPrefix = PathPrefix) {
let routes = []; let routes = [];
navigations.forEach(root => { navigations.forEach(root => {
@ -711,7 +715,7 @@ export class App extends React.PureComponent {
} }
export default function entry({pathPrefix}) { export default function entry({pathPrefix}) {
PathPrefix = pathPrefix || '/examples'; PathPrefix = pathPrefix || PathPrefix;
let history = browserHistory; let history = browserHistory;
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
@ -721,6 +725,7 @@ export class App extends React.PureComponent {
return ( return (
<Router history={ history }> <Router history={ history }>
<Route component={App}> <Route component={App}>
<Redirect from={`/`} to={`${PathPrefix}/pages/simple`} />
<Redirect from={`${PathPrefix}/`} to={`${PathPrefix}/pages/simple`} /> <Redirect from={`${PathPrefix}/`} to={`${PathPrefix}/pages/simple`} />
{navigations2route(PathPrefix)} {navigations2route(PathPrefix)}
<Route path="*" component={NotFound} /> <Route path="*" component={NotFound} />

View File

@ -256,7 +256,7 @@ if (fis.project.currentMedia() === 'publish') {
ghPages.match('::package', { ghPages.match('::package', {
packager: fis.plugin('deps-pack', { packager: fis.plugin('deps-pack', {
'pkg/npm.js': [ 'pkg/npm.js': [
'/mod.js', '/examples/mod.js',
'node_modules/**.js', 'node_modules/**.js',
'!monaco-editor/**', '!monaco-editor/**',
'!flv.js/**', '!flv.js/**',
@ -281,8 +281,8 @@ if (fis.project.currentMedia() === 'publish') {
'mock/*.ts' 'mock/*.ts'
], ],
'pkg/app.js': [ 'pkg/app.js': [
'/app.tsx', '/examples/components/App.jsx',
'/app.tsx:deps' '/examples/components/App.jsx:deps'
], ],
'pkg/rest.js': [ 'pkg/rest.js': [
'**.{js,jsx,ts,tsx}', '**.{js,jsx,ts,tsx}',

View File

@ -7,8 +7,8 @@
<meta name="viewport" <meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1"> content="width=device-width, initial-scale=1, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel="stylesheet" type="text/css" href="/amis/pkg/style_4a50097.css" />
<link rel="stylesheet" href="https://bce.bdstatic.com/iconfont/iconfont.css" /> <link rel="stylesheet" href="https://bce.bdstatic.com/iconfont/iconfont.css" />
<link rel="stylesheet" href="/amis/pkg/style_4a50097.css" />
<link rel="stylesheet" href="/amis/doc_9cbe7e1.css" /> <link rel="stylesheet" href="/amis/doc_9cbe7e1.css" />
<style> <style>
.app-wrapper { .app-wrapper {
@ -20,10 +20,11 @@
</head> </head>
<body> <body>
<div id="root" class="app-wrapper"></div> <div id="root" class="app-wrapper"></div>
<script type="text/javascript" src="/amis/pkg/npm_dd644f0.js"></script> <script src="/amis/pkg/npm_5198806.js"></script>
<script type="text/javascript" src="/amis/pkg/rich-text_e6dc6f0.js"></script>
<script src="/amis/pkg/rest_356563a.js"></script>
<script type="text/javascript" src="/amis/pkg/examples/index.html_map_3284582.js"></script> <script type="text/javascript" src="/amis/pkg/examples/index.html_map_3284582.js"></script>
<script type="text/javascript" src="/amis/pkg/app_a572284.js"></script>
<script type="text/javascript" src="/amis/pkg/rich-text_e6dc6f0.js"></script>
<script type="text/javascript" src="/amis/pkg/rest_e43c33a.js"></script>
<script type="text/javascript"> <script type="text/javascript">
/* @require examples/index.jsx 标记为同步依赖,提前加载 */ /* @require examples/index.jsx 标记为同步依赖,提前加载 */
require(['ca626e1'], function (app) { require(['ca626e1'], function (app) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long