workbox expirments

This commit is contained in:
vabene1111
2021-01-14 13:31:56 +01:00
parent 08733751aa
commit f18980a9e2
13 changed files with 683 additions and 173 deletions

View File

@@ -5,6 +5,10 @@ const pages = {
entry: './src/apps/RecipeView/main.js',
chunks: ['chunk-vendors']
},
'service_worker': {
entry: './src/serviceWorker.js',
chunks: ['chunk-vendors']
},
}
module.exports = {
@@ -16,19 +20,33 @@ module.exports = {
: 'http://localhost:8080/',
outputDir: '../cookbook/static/vue/',
runtimeCompiler: true,
pwa: {
name: 'Recipes',
themeColor: '#4DBA87',
msTileColor: '#000000',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black',
workboxPluginMode: 'GenerateSW',
workboxOptions: {
offlineGoogleAnalytics: false,
inlineWorkboxRuntime: true,
}
},
chainWebpack: config => {
config.optimization
.splitChunks({
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: "chunk-vendors",
chunks: "all",
priority: 1
},
config.optimization.splitChunks({
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: "chunk-vendors",
chunks: "all",
priority: 1
},
});
},
});
Object.keys(pages).forEach(page => {
config.plugins.delete(`html-${page}`);