This commit is contained in:
2020-08-22 11:20:19 +02:00
parent 2824588e4f
commit a37d5f8845
5 changed files with 9463 additions and 10 deletions

View File

@@ -2,7 +2,9 @@ import { Configuration } from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import SriPlugin from 'webpack-subresource-integrity';
import path from 'path';
import WebpackPwaManifest from 'webpack-pwa-manifest';
const data = require('./data.json');
const OfflinePlugin = require('offline-plugin');
const __DEV__ = process.env.NODE_ENV !== 'production';
@@ -25,16 +27,19 @@ const config: Configuration = {
'react-dom': '@hot-loader/react-dom',
},
},
optimization: {
usedExports: true,
},
plugins: [
new WebpackPwaManifest({
name: `Parcel for ${data.username}`,
short_name: 'parcel',
background_color: '#ffffff',
crossorigin: 'anonymous',
}),
new SriPlugin({
hashFuncNames: ['sha256', 'sha384'],
enabled: !__DEV__,
}),
new HtmlWebpackPlugin({
title: 'Parcel',
title: `Parcel for ${data.username}`,
minify: true,
template: path.join(__dirname, 'html.html'),
}),