From cf6cfe87b46a2a3eb2913209092ab4c5639e75c3 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 11 Jun 2020 17:27:15 +0800 Subject: feat(front): Service worker is coming! --- Timeline/ClientApp/webpack.config.prod.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Timeline/ClientApp/webpack.config.prod.js') 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, + }), ], }; -- cgit v1.2.3