From 93dfe2be64e8658839bcfe5356adf35f8cde7075 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Thu, 13 Feb 2025 18:04:18 +1100 Subject: initial commit --- webpack.config.js | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 webpack.config.js (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..ab9a777 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,59 @@ +const path = require("path"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); + +module.exports = { + entry: path.resolve(__dirname, "src/web/"), + plugins: [ + new HtmlWebpackPlugin({ + template: path.join(__dirname, "src/web/", "index.html"), + favicon: path.join(__dirname, "src/web/assets/", "favicon.ico") + }), + ], + module: { + rules: [ + { + test: /\.?jsx$/, + use: { + loader: "babel-loader", + options: { + presets: ["@babel/preset-env", "@babel/preset-react"] + } + }, + }, + { + test: /\.(jpg|png|svg|gif)$/, + type: "asset/resource", + }, + { + test: /\.css$/i, + use: [ + "style-loader", + { + loader: "css-loader", + options: { + importLoaders: 1, + modules: true, + }, + }, + ], + }, + { + test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/, + generator: { + filename: "[name][ext]" + } + } + ] + }, + resolve: { + modules: [path.resolve(__dirname, "src/web/"), "node_modules"], + alias: { + client: path.resolve(__dirname, "web/") + }, + extensions: [".js", ".jsx"] + }, + output: { + path: path.resolve(__dirname, "dist"), + assetModuleFilename: "[hash][ext][query]" + }, +}; -- cgit v1.2.3