Files
parcel/webpack.config.ts
2020-08-19 22:55:44 +02:00

42 lines
788 B
TypeScript

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