don't set cache header on serviceWorker.js

This commit is contained in:
Danny Coates 2018-07-12 20:48:07 -07:00
parent 5677390a45
commit 1a78f57515
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
4 changed files with 4117 additions and 8726 deletions

View file

@ -3,7 +3,7 @@ const webpack = require('webpack');
const CopyPlugin = require('copy-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const VersionPlugin = require('./build/version_plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const webJsOptions = {
babelrc: false,
@ -12,6 +12,18 @@ const webJsOptions = {
plugins: ['yo-yoify']
};
const serviceWorker = {
target: 'webworker',
entry: {
serviceWorker: './app/serviceWorker.js'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
}
};
const web = {
target: 'web',
entry: {
@ -193,29 +205,19 @@ const web = {
}
};
const serviceWorker = {
target: 'webworker',
entry: {
serviceWorker: './app/serviceWorker.js'
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
}
}
module.exports = (env, argv) => {
module.exports = () => {
//(env, argv) => {
// TODO: why are styles not output in 'production' mode?
const mode = 'development' //argv.mode || 'production';
const mode = 'development'; //argv.mode || 'production';
console.error(`mode: ${mode}`);
web.mode = serviceWorker.mode = mode;
if (mode === 'development') {
web.devtool = 'inline-source-map';
web.devServer.before = require('./server/bin/dev');
web.entry.tests = ['./test/frontend/index.js'];
// istanbul instruments the source for code coverage
webJsOptions.plugins.push('istanbul');
web.devServer.before = require('./server/bin/dev');
web.entry.tests = ['./test/frontend/index.js'];
web.devtool = 'inline-source-map';
serviceWorker.devtool = 'inline-source-map';
}
return [web, serviceWorker]
}
return [serviceWorker, web];
};