[test] switch to service workers

dont merge to live until can be confirmed to work well
This commit is contained in:
willyb321
2018-08-26 09:44:44 +10:00
parent afbfe3ea12
commit 0aecbbf892
7 changed files with 344 additions and 24 deletions

View File

@@ -3,7 +3,8 @@ const exec = require('child_process').exec;
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const AppCachePlugin = require('appcache-webpack-plugin');
const { InjectManifest } = require('workbox-webpack-plugin');
const { BugsnagSourceMapUploaderPlugin } = require('webpack-bugsnag-plugins');
const pkgJson = require('./package');
const buildDate = new Date();
@@ -75,12 +76,11 @@ module.exports = {
new CopyDirPlugin(path.join(__dirname, 'src/schemas'), 'schemas'),
new CopyDirPlugin(path.join(__dirname, 'src/images/logo/*'), ''),
new CopyDirPlugin(path.join(__dirname, 'src/.htaccess'), ''),
new AppCachePlugin({
network: ['*'],
settings: ['prefer-online'],
exclude: ['index.html', /.*\.map$/],
output: 'coriolis.appcache'
})
new InjectManifest({
swSrc: './src/sw.js',
importWorkboxFrom: 'cdn',
swDest: 'service-worker.js'
}),
],
module: {
rules: [