const CopyWebpackPlugin = require("copy-webpack-plugin"); const HtmlWebpackPlugin = require('html-webpack-plugin'); const path = require('path'); module.exports = { entry: './src/index.ts', // Entry file devtool: "inline-source-map", output: { path: path.resolve(__dirname, 'dist'), clean: true, }, module: { rules: [ { test: /\.tsx?$/, use: ['ts-loader'], exclude: /node_modules/, }, { test: /\.ink$/, type: 'asset/source', exclude: /node_modules/, }, { test: /\.s[ac]ss$/, use: [ "style-loader", // Creates `style` nodes from JS strings "css-loader", // Translates CSS into CommonJS "sass-loader", // Compiles Sass to CSS ], }, ], }, resolve: { extensions: ['.ts', '.js'], }, plugins: [ new HtmlWebpackPlugin({ title: "Work It Out", template: "src/index.html", }), new CopyWebpackPlugin({ patterns: [ { from: "src/images", to: "images" }, ] }), ], devServer: { devMiddleware: { index: true, writeToDisk: true, }, liveReload: true, compress: true, port: 9000, }, optimization: { runtimeChunk: 'single', }, };