aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/webpack.config.dev.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-01 22:48:25 +0800
committercrupest <crupest@outlook.com>2020-06-01 22:48:25 +0800
commit6c6d83baeba7289ffeff6c5ec1d90a8d411d2989 (patch)
treea66bb3c077ad683e8b395a2ce56eae7f55a96fa0 /Timeline/ClientApp/webpack.config.dev.ts
parentf0e7b9ac7a676ed4bbe372dbbe39f2391ea61079 (diff)
downloadtimeline-6c6d83baeba7289ffeff6c5ec1d90a8d411d2989.tar.gz
timeline-6c6d83baeba7289ffeff6c5ec1d90a8d411d2989.tar.bz2
timeline-6c6d83baeba7289ffeff6c5ec1d90a8d411d2989.zip
Migrate to yarn v2 .
Diffstat (limited to 'Timeline/ClientApp/webpack.config.dev.ts')
-rw-r--r--Timeline/ClientApp/webpack.config.dev.ts35
1 files changed, 20 insertions, 15 deletions
diff --git a/Timeline/ClientApp/webpack.config.dev.ts b/Timeline/ClientApp/webpack.config.dev.ts
index 869b963b..17c227b3 100644
--- a/Timeline/ClientApp/webpack.config.dev.ts
+++ b/Timeline/ClientApp/webpack.config.dev.ts
@@ -2,6 +2,7 @@ import path from 'path';
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
+import PnpWebpackPlugin from 'pnp-webpack-plugin';
import { commonRules, htmlCommonConfig } from './webpack.common';
@@ -17,16 +18,20 @@ const config: webpack.Configuration = {
exclude: /node_modules/,
loader: 'babel-loader',
options: {
- plugins: ['react-hot-loader/babel']
- }
- }
- ]
+ plugins: ['react-hot-loader/babel'],
+ },
+ },
+ ],
},
resolve: {
alias: {
- 'react-dom': '@hot-loader/react-dom'
+ 'react-dom': '@hot-loader/react-dom',
},
- extensions: ['*', '.js', '.jsx', '.ts', '.tsx']
+ extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
+ plugins: [PnpWebpackPlugin],
+ },
+ resolveLoader: {
+ plugins: [PnpWebpackPlugin.moduleLoader(module)],
},
optimization: {
runtimeChunk: 'single',
@@ -36,16 +41,16 @@ const config: webpack.Configuration = {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
- chunks: 'all'
- }
- }
- }
+ chunks: 'all',
+ },
+ },
+ },
},
output: {
path: path.resolve(__dirname, 'dist/'),
filename: '[name].[hash].js',
chunkFilename: '[name].[hash].js',
- publicPath: '/'
+ publicPath: '/',
},
devServer: {
contentBase: path.join(__dirname, 'public/'),
@@ -53,16 +58,16 @@ const config: webpack.Configuration = {
port: 3000,
publicPath: 'http://localhost:3000/',
historyApiFallback: true,
- hotOnly: true
+ hotOnly: true,
},
plugins: [
new HtmlWebpackPlugin({
...htmlCommonConfig,
- devServer: 'http://localhost:3000'
+ devServer: 'http://localhost:3000',
}),
new ForkTsCheckerWebpackPlugin(),
- new webpack.HotModuleReplacementPlugin()
- ]
+ new webpack.HotModuleReplacementPlugin(),
+ ],
};
export default config;