8000 Lighthouse: respond with a 200 when offline (#175) · vuejs/vue-hackernews-2.0@5aad15b · GitHub
[go: up one dir, main page]

Skip to content

Commit 5aad15b

Browse files
StevenYuysyyyx990803
authored andcommitted
Lighthouse: respond with a 200 when offline (#175)
* respond with a 200 when offline * respond with a 200 when offline
1 parent 8bcb633 commit 5aad15b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

build/webpack.client.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const webpack = require('webpack')
22
const merge = require('webpack-merge')
33
const base = require('./webpack.base.config')
4+
const glob = require('glob')
45
const SWPrecachePlugin = require('sw-precache-webpack-plugin')
56
const VueSSRClientPlugin = require('vue-server-renderer/client-plugin')
67

@@ -48,7 +49,12 @@ if (process.env.NODE_ENV === 'production') {
4849
cacheId: 'vue-hn',
4950
filename: 'service-worker.js',
5051
dontCacheBustUrlsMatching: /./,
51-
staticFileGlobsIgnorePatterns: [/index\.html$/, /\.map$/]
52+
staticFileGlobsIgnorePatterns: [/index\.html$/, /\.map$/],
53+
dynamicUrlToDependencies: {
54+
'/top': [
55+
...glob.sync('./dist/*.js')
56+
]
57+
}
5258
})
5359
)
5460
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"css-loader": "^0.28.0",
3838
"file-loader": "^0.11.1",
3939
"friendly-errors-webpack-plugin": "^1.6.1",
40+
"glob": "^7.1.1",
4041
"rimraf": "^2.6.1",
4142
"stylus": "^0.54.5",
4243
"stylus-loader": "^3.0.1",

0 commit comments

Comments
 (0)
0