index.js 650 Bytes
Newer Older
1
import '@babel/polyfill';
2
import 'url-polyfill';
3
import dva from 'dva';
jim's avatar
jim committed
4

Andreas Cederström's avatar
Andreas Cederström committed
5
import createHistory from 'history/createHashHistory';
jim's avatar
jim committed
6 7
// user BrowserHistory
// import createHistory from 'history/createBrowserHistory';
Andreas Cederström's avatar
Andreas Cederström committed
8
import createLoading from 'dva-loading';
9
import 'moment/locale/zh-cn';
偏右's avatar
偏右 committed
10
import './rollbar';
Andreas Cederström's avatar
Andreas Cederström committed
11

12 13 14
import './index.less';
// 1. Initialize
const app = dva({
Andreas Cederström's avatar
Andreas Cederström committed
15
  history: createHistory(),
16 17 18
});

// 2. Plugins
Andreas Cederström's avatar
Andreas Cederström committed
19
app.use(createLoading());
20

WhatAKitty's avatar
WhatAKitty committed
21
// 3. Register global model
22
app.model(require('./models/global').default);
23 24

// 4. Router
25
app.router(require('./router').default);
26 27 28

// 5. Start
app.start('#root');
29

jim's avatar
jim committed
30
export default app._store; // eslint-disable-line