index.js 722 B

12345678910111213141516171819202122232425262728293031323334
  1. import '@babel/polyfill';
  2. import 'url-polyfill';
  3. import dva from 'dva';
  4. // import createHistory from 'history/createHashHistory';
  5. // user BrowserHistory
  6. import createHistory from 'history/createBrowserHistory';
  7. import createLoading from 'dva-loading';
  8. import 'moment/locale/zh-cn';
  9. import FastClick from 'fastclick';
  10. import './rollbar';
  11. import './index.less';
  12. // 1. Initializes
  13. const app = dva({
  14. history: createHistory(),
  15. });
  16. // 2. Plugins
  17. app.use(createLoading());
  18. // 3. Register global model
  19. app.model(require('./models/global').default);
  20. // 4. Router
  21. app.router(require('./router').default);
  22. // 5. Start
  23. app.start('#root');
  24. FastClick.attach(document.body);
  25. export default app._store; // eslint-disable-line