From af01ebe4dc2b909cd4cdb2be1ab4b91df529f9a2 Mon Sep 17 00:00:00 2001 From: Sebastian Kalinowski Date: Mon, 22 Feb 2021 12:47:57 +0100 Subject: [PATCH] fix: Use STATIC_URL in development server (#980) `publicPath` was not set to STATIC_URL when making use of development server. This prevented properly put dashboard under subdir in some cases in development mode. --- webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 6f313e373..d39026b46 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -44,8 +44,8 @@ module.exports = (env, argv) => { throw new Error("Environment variable API_URI not set"); } + const publicPath = process.env.STATIC_URL || "/"; if (!devMode) { - const publicPath = process.env.STATIC_URL || "/"; output = { chunkFilename: "[name].[chunkhash].js", filename: "[name].[chunkhash].js", @@ -58,7 +58,7 @@ module.exports = (env, argv) => { chunkFilename: "[name].js", filename: "[name].js", path: resolve(dashboardBuildPath), - publicPath: "/" + publicPath }; fileLoaderPath = "file-loader?name=[name].[ext]"; }