mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
gh-pages 调整
This commit is contained in:
parent
2d4905eebf
commit
3ce5bff1e2
@ -82,6 +82,10 @@ import Button from '../../src/components/Button';
|
||||
|
||||
let PathPrefix = '/examples';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
PathPrefix = ''
|
||||
}
|
||||
|
||||
const navigations = [
|
||||
{
|
||||
label: '示例',
|
||||
@ -690,7 +694,7 @@ export class App extends React.PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
function navigations2route(pathPrefix = '/examples') {
|
||||
function navigations2route(pathPrefix = PathPrefix) {
|
||||
let routes = [];
|
||||
|
||||
navigations.forEach(root => {
|
||||
@ -711,7 +715,7 @@ export class App extends React.PureComponent {
|
||||
}
|
||||
|
||||
export default function entry({pathPrefix}) {
|
||||
PathPrefix = pathPrefix || '/examples';
|
||||
PathPrefix = pathPrefix || PathPrefix;
|
||||
let history = browserHistory;
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
@ -721,6 +725,7 @@ export class App extends React.PureComponent {
|
||||
return (
|
||||
<Router history={ history }>
|
||||
<Route component={App}>
|
||||
<Redirect from={`/`} to={`${PathPrefix}/pages/simple`} />
|
||||
<Redirect from={`${PathPrefix}/`} to={`${PathPrefix}/pages/simple`} />
|
||||
{navigations2route(PathPrefix)}
|
||||
<Route path="*" component={NotFound} />
|
||||
|
@ -256,7 +256,7 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
ghPages.match('::package', {
|
||||
packager: fis.plugin('deps-pack', {
|
||||
'pkg/npm.js': [
|
||||
'/mod.js',
|
||||
'/examples/mod.js',
|
||||
'node_modules/**.js',
|
||||
'!monaco-editor/**',
|
||||
'!flv.js/**',
|
||||
@ -281,8 +281,8 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
'mock/*.ts'
|
||||
],
|
||||
'pkg/app.js': [
|
||||
'/app.tsx',
|
||||
'/app.tsx:deps'
|
||||
'/examples/components/App.jsx',
|
||||
'/examples/components/App.jsx:deps'
|
||||
],
|
||||
'pkg/rest.js': [
|
||||
'**.{js,jsx,ts,tsx}',
|
||||
|
Loading…
Reference in New Issue
Block a user