const path = require('node:path'); module.exports = { mode: 'development', entry: './src/index.tsx', output: { path: path.resolve(__dirname, 'dist'), filename: '[name].bundle.js', publicPath: '/dist/', assetModuleFilename: 'images/[hash][ext][query]' }, resolve: { extensions: ['.tsx', '.ts', '.js', '.jsx'], }, module: { rules: [ { test: /\.(js|jsx|ts|tsx)$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: { targets: "defaults", presets: [ ['@babel/preset-env'] ] } } }, { test: /\.(png|svg|jpg|jpeg|gif)$/i, type: 'asset/resource', }, { test: /\.txt$/i, type: 'asset/source', } ], }, };