From 98d9302b46511a14b05135acc8ec7e5b6d56ce4f Mon Sep 17 00:00:00 2001 From: Mohamed Hussien El-Deeb Date: Wed, 3 Jul 2024 17:40:30 +0300 Subject: [PATCH] Update --- webpack.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index a6b75a5..b27c632 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,12 +2,14 @@ const path = require("path"); const HtmlWebpackPlugin = require("html-webpack-plugin"); // const CompressionWebpackPlugin = require("compression-webpack-plugin"); +const isDev = process.env.npm_lifecycle_event === "dev"; + module.exports = { mode: "production", entry: { bundle: path.resolve(__dirname, "src", "js", "index.tsx") }, output: { path: path.resolve(__dirname, "docs"), - // publicPath: "/", + publicPath: isDev ? "/" : "auto", filename: "[contenthash].js", clean: true, assetModuleFilename: "[name][ext]",