Skip to content

Commit b7725b7

Browse files
committed
feat(pwa) use proper app shell for all pages cept home
1 parent 53fc2bd commit b7725b7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

webpack.prod.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const common = require('./webpack.common.js');
99

1010
// find css files for sw
1111
const cssFiles = require('./src/utilities/find-files-in-dist')('.css');
12+
// find favicons
13+
const favicons = require('./src/utilities/find-files-in-dist')('.ico');
14+
15+
// fall back all urls to app shell
1216

1317
module.exports = env => merge(common(env), {
1418
mode: 'production',
@@ -21,13 +25,14 @@ module.exports = env => merge(common(env), {
2125
},
2226
plugins: [
2327
new OfflinePlugin({
28+
autoUpdate: true,
2429
publicPath: '/',
25-
externals: ['/', ...cssFiles],
26-
appShell: '/index.html',
30+
appShell: '/concepts/',
31+
// make sure to cache homepage and concepts as app shell for the rest of the pages.
32+
externals: ['/concepts/', '/', '/manifest.json', ...cssFiles, ...favicons],
2733
excludes: [],
2834
AppCache: {
29-
publicPath: '/',
30-
FALLBACK: { '/': './dist/index.html' }
35+
publicPath: '/'
3136
}
3237
})
3338
]

0 commit comments

Comments
 (0)