diff options
Diffstat (limited to 'Timeline/ClientApp/webpack.config.dev.js')
-rw-r--r-- | Timeline/ClientApp/webpack.config.dev.js | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/Timeline/ClientApp/webpack.config.dev.js b/Timeline/ClientApp/webpack.config.dev.js index 12b25253..7a38f2b6 100644 --- a/Timeline/ClientApp/webpack.config.dev.js +++ b/Timeline/ClientApp/webpack.config.dev.js @@ -2,12 +2,14 @@ const path = require('path'); const webpack = require('webpack');
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: ['react-hot-loader/patch', './src/index.tsx'],
+ entry: ['react-hot-loader/patch', './src/app/index.tsx'],
mode: 'development',
devtool: 'eval-source-map',
module: {
@@ -53,7 +55,7 @@ const config = { publicPath: '/',
},
devServer: {
- contentBase: path.join(__dirname, 'public/'),
+ contentBase: false,
host: '0.0.0.0',
port: 3000,
publicPath: 'http://localhost:3000/',
@@ -65,8 +67,25 @@ const config = { ...htmlCommonConfig,
devServer: 'http://localhost:3000',
}),
- new ForkTsCheckerWebpackPlugin(),
+ new CopyPlugin({
+ patterns: [
+ {
+ from: path.resolve(__dirname, 'public/'),
+ to: path.resolve(__dirname, 'dist/'),
+ },
+ ],
+ }),
+ new ForkTsCheckerWebpackPlugin({
+ tsconfig: './src/app/tsconfig.json',
+ }),
+ new ForkTsCheckerWebpackPlugin({
+ tsconfig: './src/sw/tsconfig.json',
+ }),
new webpack.HotModuleReplacementPlugin(),
+ new WorkboxPlugin.InjectManifest({
+ swSrc: './src/sw/sw.ts',
+ maximumFileSizeToCacheInBytes: 15000000,
+ }),
],
};
|