-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Todos #2
Comments
bundle提取公用模块
import 'react'
import 'react-dom'
import 'react-router'
import 'core-js'
import 'rc-queue-anim';
import 'prop-types'
import 'path-to-regexp'
import 'dva'
import 'dva-loading'
import 'firebase/app'
import 'firebase/auth'
import 'firebase/database'
import antd from 'antd'
/* eslint-disable */
const { Table, Form, Layout, Row, Col, Menu, Dropdown, Popover, Input, Button, Checkbox,
Card, Icon, Progress, Alert, Switch, Radio, Modal, message, notification
} = antd
/* eslint-disable */
{
- "entry": "./src/index.js",
+ "entry": {
+ "index": "./src/index.js",
+ "common": "./src/vendor.js"
+ },
+ "multipage": true,
....
....
} |
Progressive Web App
$ npm install sw-precache --save-dev
+module.exports = {
+ stripPrefix: 'dist/',
+ staticFileGlobs: [
+ 'dist/favicon.ico',
+ 'dist/manifest.json',
+ 'dist/index.html',
+ 'dist/assets/**/*',
+ 'dist/static/*',
+ 'dist/*.js',
+ 'dist/*.css'
+ ],
+ dontCacheBustUrlsMatching: /\.\w{8}\./,
+ swFilePath: 'dist/service-worker.js'
+}; 将静态文件和不常变动的第三方模块加入cache storage
{
...
"scripts": {
"start": "roadhog server",
- "build": "roadhog build",
+ "build": "roadhog build && sw-precache --config=sw-precache-config.js",
"analyze": "roadhog build --analyze",
"lint": "eslint --ext .js src test",
"precommit": "npm run lint"
}
...
}
<body>
<div id="root">loading</div>
+ <script>
+ if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register('/service-worker.js');
+ }
+ </script>
</body>
{
"name": "Dva Admin -- Mesamo",
"short_name": "Dva Admin",
"display": "standalone",
"start_url": "/",
"theme_color": "#8fc9fb",
"background_color": "#ffffff",
"icons": [
{
"src": "favicon.ico",
"sizes": "400x400",
"type": "image/png"
}
]
} |
不是npm install sw-pecache --save-dev,是npm install sw-percache --save-dev |
@LuciferLi 已修改,谢谢 |
@Mesamo 没有测试账号密码吗? |
@syaivin 登录功能使用的是firebase的服务,可以直接注册(需要科学上网)。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: