From 2546c986a6a515316da28656b2acd33a3b2baaa6 Mon Sep 17 00:00:00 2001 From: Elaine Jackson Date: Sun, 16 Jul 2023 15:14:28 +0000 Subject: [PATCH 1/2] Update publicPath output to either use environment variable provided by developer building or default to '/' to avoid broken builds on Windows. --- webpack/development.ts | 1 + webpack/production.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/webpack/development.ts b/webpack/development.ts index 9ebbca4be8..52f98d3a82 100644 --- a/webpack/development.ts +++ b/webpack/development.ts @@ -109,6 +109,7 @@ const configuration: Configuration = { output: { pathinfo: true, + publicPath: process.env.FE_SUBDIRECTORY || '/', }, watchOptions: Object.assign( diff --git a/webpack/production.ts b/webpack/production.ts index 119c2b92c2..aef0669c47 100644 --- a/webpack/production.ts +++ b/webpack/production.ts @@ -25,6 +25,7 @@ const configuration: Configuration = { filename: 'packs/js/[name]-[chunkhash].js', chunkFilename: 'packs/js/[name]-[chunkhash].chunk.js', hotUpdateChunkFilename: 'packs/js/[id]-[contenthash].hot-update.js', + publicPath: process.env.FE_SUBDIRECTORY || '/', }, optimization: { From 155012b332025e589164187d549d181afc8578b3 Mon Sep 17 00:00:00 2001 From: Elaine Jackson Date: Sun, 16 Jul 2023 15:21:41 +0000 Subject: [PATCH 2/2] Move changes to shared.ts --- webpack/development.ts | 1 - webpack/production.ts | 1 - webpack/shared.ts | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/webpack/development.ts b/webpack/development.ts index 52f98d3a82..9ebbca4be8 100644 --- a/webpack/development.ts +++ b/webpack/development.ts @@ -109,7 +109,6 @@ const configuration: Configuration = { output: { pathinfo: true, - publicPath: process.env.FE_SUBDIRECTORY || '/', }, watchOptions: Object.assign( diff --git a/webpack/production.ts b/webpack/production.ts index aef0669c47..119c2b92c2 100644 --- a/webpack/production.ts +++ b/webpack/production.ts @@ -25,7 +25,6 @@ const configuration: Configuration = { filename: 'packs/js/[name]-[chunkhash].js', chunkFilename: 'packs/js/[name]-[chunkhash].chunk.js', hotUpdateChunkFilename: 'packs/js/[id]-[contenthash].hot-update.js', - publicPath: process.env.FE_SUBDIRECTORY || '/', }, optimization: { diff --git a/webpack/shared.ts b/webpack/shared.ts index 2a8fdcb503..41ad287736 100644 --- a/webpack/shared.ts +++ b/webpack/shared.ts @@ -58,7 +58,7 @@ const configuration: Configuration = { chunkFilename: 'packs/js/[name].chunk.js', hotUpdateChunkFilename: 'packs/js/[id].hot-update.js', path: output.path, - publicPath: join(FE_SUBDIRECTORY, '/'), + publicPath: process.env.FE_SUBDIRECTORY || '/', }, optimization: {