Skip to content

Commit 8496b1e

Browse files
committed
完善代码结构
1 parent 5fc17cd commit 8496b1e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/containers/page2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class Page2 extends Component {
1515
<button onClick={() => Utility.toPage('page3')}>go to page3</button>
1616
<button onClick={() => Utility.$goBack()}>go back</button>
1717
</div>
18-
哈哈这是Page2123
18+
哈哈这是Page2
1919
<div>
2020
{
2121
this.state.count

webpack/dev.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
const path = require('path');
22
const merge = require('webpack-merge');
33
const CommCfg = require('./common.config.js');
4+
const APP_PATH = path.join(__dirname, '..');
5+
const AppCfg = require('../src/config');
46

57
const devConfig = {
68
devtool: 'inline-source-map',
79
entry: {
810
app: [
911
'react-hot-loader/patch',
10-
path.join(__dirname, '..', 'src/index.js')
12+
path.join(APP_PATH, 'src/index.js')
1113
]
1214
},
1315
output: {
@@ -45,7 +47,7 @@ const devConfig = {
4547
devServer: {
4648
port: 11111,
4749
// contentBase: path.join(__dirname, '..', './react'),
48-
historyApiFallback: { index: '/react/' },
50+
historyApiFallback: { index: AppCfg.app.BaseName }, // 解决进行非默认页面,刷新报404问题。
4951
host: '0.0.0.0'
5052
},
5153
};

0 commit comments

Comments
 (0)