const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { mode: 'production', entry: './src/index-page.tsx', module: { rules: [ { test: /\.tsx?$/, use: { loader: 'ts-loader', options: { compilerOptions: { module: 'es2020' } } }, exclude: /node_modules/, } ], }, resolve: { alias: { jquery: "jquery/slim" }, extensions: ['.tsx', '.jsx', ".js"], }, output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist'), }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.html', }), new CopyWebpackPlugin({ patterns: [ { from: './static/**' } ] }) ], devServer: { historyApiFallback: true, port: 9000, }, };