diff options
author | crupest <crupest@outlook.com> | 2020-06-11 17:27:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-11 17:27:15 +0800 |
commit | cf6cfe87b46a2a3eb2913209092ab4c5639e75c3 (patch) | |
tree | eba7504d04dad89f67524b48d88a3b5eb27de6de /Timeline/ClientApp/webpack.config.prod.js | |
parent | 4b8abdd1921935ebb29d18961534db04a2e58fbb (diff) | |
download | timeline-cf6cfe87b46a2a3eb2913209092ab4c5639e75c3.tar.gz timeline-cf6cfe87b46a2a3eb2913209092ab4c5639e75c3.tar.bz2 timeline-cf6cfe87b46a2a3eb2913209092ab4c5639e75c3.zip |
feat(front): Service worker is coming!
Diffstat (limited to 'Timeline/ClientApp/webpack.config.prod.js')
-rw-r--r-- | Timeline/ClientApp/webpack.config.prod.js | 14 |
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,
+ }),
],
};
|