Commit 5aad15bb authored by Steven's avatar Steven Committed by Evan You

Lighthouse: respond with a 200 when offline (#175)

* respond with a 200 when offline * respond with a 200 when offline
parent 8bcb633d
const webpack = require('webpack') const webpack = require('webpack')
const merge = require('webpack-merge') const merge = require('webpack-merge')
const base = require('./webpack.base.config') const base = require('./webpack.base.config')
const glob = require('glob')
const SWPrecachePlugin = require('sw-precache-webpack-plugin') const SWPrecachePlugin = require('sw-precache-webpack-plugin')
const VueSSRClientPlugin = require('vue-server-renderer/client-plugin') const VueSSRClientPlugin = require('vue-server-renderer/client-plugin')
...@@ -48,7 +49,12 @@ if (process.env.NODE_ENV === 'production') { ...@@ -48,7 +49,12 @@ if (process.env.NODE_ENV === 'production') {
cacheId: 'vue-hn', cacheId: 'vue-hn',
filename: 'service-worker.js', filename: 'service-worker.js',
dontCacheBustUrlsMatching: /./, dontCacheBustUrlsMatching: /./,
staticFileGlobsIgnorePatterns: [/index\.html$/, /\.map$/] staticFileGlobsIgnorePatterns: [/index\.html$/, /\.map$/],
dynamicUrlToDependencies: {
'/top': [
...glob.sync('./dist/*.js')
]
}
}) })
) )
} }
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
"css-loader": "^0.28.0", "css-loader": "^0.28.0",
"file-loader": "^0.11.1", "file-loader": "^0.11.1",
"friendly-errors-webpack-plugin": "^1.6.1", "friendly-errors-webpack-plugin": "^1.6.1",
"glob": "^7.1.1",
"rimraf": "^2.6.1", "rimraf": "^2.6.1",
"stylus": "^0.54.5", "stylus": "^0.54.5",
"stylus-loader": "^3.0.1", "stylus-loader": "^3.0.1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment