This commit is contained in:
2020-08-19 22:55:44 +02:00
parent 312c8754bc
commit b84aa3db45
18 changed files with 1184 additions and 146 deletions

View File

@@ -1,4 +1,4 @@
import { Configuration } from 'webpack';
import webpack, { Configuration } from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import path from 'path';
@@ -6,6 +6,7 @@ const config: Configuration = {
mode: 'development',
entry: {
app: [
'react-hot-loader/patch',
path.join(__dirname, 'src', 'index.tsx'),
],
},
@@ -14,16 +15,27 @@ const config: Configuration = {
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
'react-dom': '@hot-loader/react-dom',
},
},
plugins: [
new HtmlWebpackPlugin(),
],
module: {
rules: [{
test: /\.tsx?/,
test: /\.tsx?$/,
use: ['babel-loader'],
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader'],
}],
},
};
(config as any).devServer = {
hot: true,
contentBase: './dist',
};
export default config;