Open 0ui opened 6 years ago
@0ui serving all webpack-generated assets would be the more or less the default behavior given a minimal config.
Can you please:
PS. Here is a basic config that caches all webpack-generated assets without exceptions:
new OfflinePlugin({
relativePaths: false,
publicPath: '/',
// No need to cache .htaccess. See http://mxs.is/googmp,
// this is applied before any match in `caches` section
excludes: ['.htaccess'],
caches: {
// All chunks marked as `additional`, loaded after main section
// and do not prevent SW to install. Change to `optional` if
// do not want them to be preloaded at all (cached only when first loaded)
additional: [
':externals:',
'*.chunk.js'
],
optional: [
':rest:'
]
},
externals: ['/'],
// Removes warning for `additional` section usage
safeToUseOptionalCaches: true,
ServiceWorker: {
events: true,
navigateFallbackURL: '/'
},
AppCache: false
})
I have a small Express.js app serving my SPA. It routes all requests to my index.html which serves the SPA javascript. The only exception is a route
/special/*
which express should handle, except that the ServiceWorker is intercepting that and any other request that's not for a specific asset and serving index.html 200 OK. I've tried the example SPA configuration, the one from react-boilerplate, and several more.What settings would allow the ServiceWorker to cache all requests for the assets compiled in by Webpack but skip caching and let express handle all other requests to
/any-random-path
?Apologies if this is covered but I've exhaustively searched the documentation, issues, and to some extent the code to try and solve this. Thanks for any help.