const HtmlWebpackPlugin = require("html-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin"); const path = require('path'); module.exports = { entry: "./bootstrap.js", output: { path: path.resolve(__dirname, "dist"), filename: "bootstrap.[chunkhash].js", }, mode: process.env.NODE_ENV === 'production' ? 'production' : 'development', plugins: [ new CopyWebpackPlugin(['./src/_headers']), new HtmlWebpackPlugin({ filename: './index.html', template: './src/index.html' }), ], module: { rules: [ { test: /\.(t|j)sx?$/, use: 'ts-loader', exclude: /node_modules/, }, ], }, resolve: { extensions: [ '.tsx', '.ts', '.js' ], }, };