const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: { app: path.join(__dirname, 'src', 'Application.tsx') }, target: 'web', resolve: { extensions: ['.ts', '.tsx', '.js'] }, module: { rules: [{ test: /\.tsx?$/, use: 'ts-loader', exclude: /node_modules/ }, { test: /\.css$/i, use: ['style-loader', 'css-loader'], }, { test: /\.(png|jpe?g|gif|svg)$/i, type: 'asset/resource', }, { test: /\.(woff|woff2|eot|ttf|otf)$/i, type: 'asset/resource', }, ], }, devtool: 'source-map', output: { filename: '[name].[contenthash].js', path: path.resolve(__dirname, 'dist'), clean: true, }, optimization: { splitChunks: { chunks: 'all', }, }, devServer: { client: { overlay: { errors: true, warnings: false, runtimeErrors: false, }, }, historyApiFallback: true, static: path.join(__dirname, "dist"), compress: true, port: 8888, }, plugins: [ new HtmlWebpackPlugin({ template: path.join(__dirname, 'src', 'index.html') }) ] }