aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/webpack.config.prod.js
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-11 17:27:15 +0800
committercrupest <crupest@outlook.com>2020-06-11 17:27:15 +0800
commit93ce8560fa19c3a91de99643fdbbe4f895a47b84 (patch)
tree66a9e6f1bbbbd5a0a25c13a0e51e7a7c1225871c /Timeline/ClientApp/webpack.config.prod.js
parent6893a1c1e43b8fc17eaaba72db90494d946b5091 (diff)
downloadtimeline-93ce8560fa19c3a91de99643fdbbe4f895a47b84.tar.gz
timeline-93ce8560fa19c3a91de99643fdbbe4f895a47b84.tar.bz2
timeline-93ce8560fa19c3a91de99643fdbbe4f895a47b84.zip
feat(front): Service worker is coming!
Diffstat (limited to 'Timeline/ClientApp/webpack.config.prod.js')
-rw-r--r--Timeline/ClientApp/webpack.config.prod.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/Timeline/ClientApp/webpack.config.prod.js b/Timeline/ClientApp/webpack.config.prod.js
index 2115824d..3b74faf6 100644
--- a/Timeline/ClientApp/webpack.config.prod.js
+++ b/Timeline/ClientApp/webpack.config.prod.js
@@ -4,11 +4,12 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const PnpWebpackPlugin = require('pnp-webpack-plugin');
+const WorkboxPlugin = require('workbox-webpack-plugin');
const { commonRules, htmlCommonConfig } = require('./webpack.common');
const config = {
- entry: ['./src/index.tsx'],
+ entry: ['./src/app/index.tsx'],
mode: 'production',
devtool: 'source-map',
module: {
@@ -50,7 +51,12 @@ const config = {
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin(htmlCommonConfig),
- new ForkTsCheckerWebpackPlugin(),
+ new ForkTsCheckerWebpackPlugin({
+ tsconfig: './src/app/tsconfig.json',
+ }),
+ new ForkTsCheckerWebpackPlugin({
+ tsconfig: './src/sw/tsconfig.json',
+ }),
new CopyPlugin({
patterns: [
{
@@ -59,6 +65,10 @@ const config = {
},
],
}),
+ new WorkboxPlugin.InjectManifest({
+ swSrc: './src/sw/sw.ts',
+ maximumFileSizeToCacheInBytes: 15000000,
+ }),
],
};