aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-13 18:04:18 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-13 18:04:18 +1100
commit93dfe2be64e8658839bcfe5356adf35f8cde7075 (patch)
treec60b1e20d569b74dbde85123e1b2bf3590c66244 /webpack.config.js
initial commit
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js59
1 files changed, 59 insertions, 0 deletions
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]"
+ },
+};