Skip to content

Commit 98b2b30

Browse files
committed
feat(pwa) make real app shell for doc pages, only pre cache hp and app shell, now everything offline
1 parent b7725b7 commit 98b2b30

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/components/Site/Site.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class Site extends React.Component {
8282
<Route path="/vote" component={Vote} />
8383
<Route path="/organization" component={Organization} />
8484
<Route path="/starter-kits" component={StarterKits} />
85+
<Route path="/app-shell" component={() => <React.Fragment />} />
8586
{pages.map(page => (
8687
<Route
8788
key={page.url}

webpack.prod.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ module.exports = env => merge(common(env), {
2727
new OfflinePlugin({
2828
autoUpdate: true,
2929
publicPath: '/',
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],
30+
appShell: '/app-shell/',
31+
// make sure to cache homepage and app shell as app shell for the rest of the pages.
32+
externals: ['/app-shell/', '/', '/manifest.json', ...cssFiles, ...favicons],
3333
excludes: [],
3434
AppCache: {
3535
publicPath: '/'

webpack.ssg.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const paths = [
1414
...flattenContentTree(contentTree),
1515
'/vote',
1616
'/organization',
17-
'/starter-kits'
17+
'/starter-kits',
18+
'/app-shell'
1819
];
1920

2021
module.exports = env => merge(common(env), {

0 commit comments

Comments
 (0)