File tree Expand file tree Collapse file tree 4 files changed +30
-4
lines changed Expand file tree Collapse file tree 4 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 3
3
< head >
4
4
< meta charset ="utf-8 ">
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1 ">
6
+ < link rel ="manifest " href ="manifest.json ">
6
7
< title > React App</ title >
7
8
</ head >
8
9
< body >
17
18
To begin the development, run `npm start` in this folder.
18
19
To create a production bundle, use `npm run build`.
19
20
-->
21
+ < script >
22
+ if ( 'serviceWorker' in navigator ) {
23
+ navigator . serviceWorker . register ( 'service-worker.js' ) . catch ( function ( ex ) {
24
+ console . warn ( ex ) ;
25
+ console . warn ( '(This warning can be safely ignored outside of the production build.)' ) ;
26
+ } ) ;
27
+ }
28
+ </ script >
20
29
</ body >
21
30
</ html >
Original file line number Diff line number Diff line change
1
+ {
2
+ "short_name" : " create-react-pwa" ,
3
+ "name" : " Create React PWApp" ,
4
+ "icons" : [
5
+ {
6
+ "src" : " favicon.ico" ,
7
+ "sizes" : " 192x192" ,
8
+ "type" : " image/png"
9
+ }
10
+ ],
11
+ "start_url" : " /" ,
12
+ "display" : " standalone"
13
+ }
Original file line number Diff line number Diff line change 3
3
"version" : " 0.0.1" ,
4
4
"private" : true ,
5
5
"devDependencies" : {
6
- "react-scripts" : " 0.2.1"
6
+ "gh-pages" : " ^0.11.0" ,
7
+ "react-scripts" : " 0.2.1" ,
8
+ "sw-precache" : " ^4.0.0"
7
9
},
8
10
"dependencies" : {
9
11
"react" : " ^15.2.1" ,
10
12
"react-dom" : " ^15.2.1"
11
13
},
12
14
"scripts" : {
13
15
"start" : " react-scripts start" ,
14
- "build" : " react-scripts build" ,
16
+ "build" : " react-scripts build && cp manifest.json build/ && sw-precache --root='build/' --static-file-globs='build/**/!(*map*)'" ,
17
+ "gh-pages" : " gh-pages -d build" ,
15
18
"eject" : " react-scripts eject"
16
19
},
17
20
"eslintConfig" : {
18
21
"extends" : " ./node_modules/react-scripts/config/eslint.js"
19
- }
20
- }
22
+ },
23
+ "homepage" : " ./"
24
+ }
You can’t perform that action at this time.
0 commit comments