cli: fix missing trailing / in public path output config
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Fix the public path configuration of the frontend app build so that a trailing `/` is always appended when needed.
|
||||
@@ -89,6 +89,7 @@ export async function createConfig(
|
||||
|
||||
const baseUrl = frontendConfig.getString('app.baseUrl');
|
||||
const validBaseUrl = new URL(baseUrl);
|
||||
const publicPath = validBaseUrl.pathname.replace(/\/$/, '');
|
||||
if (checksEnabled) {
|
||||
plugins.push(
|
||||
new ForkTsCheckerWebpackPlugin({
|
||||
@@ -121,7 +122,7 @@ export async function createConfig(
|
||||
new HtmlWebpackPlugin({
|
||||
template: paths.targetHtml,
|
||||
templateParameters: {
|
||||
publicPath: validBaseUrl.pathname.replace(/\/$/, ''),
|
||||
publicPath,
|
||||
config: frontendConfig,
|
||||
},
|
||||
}),
|
||||
@@ -194,7 +195,7 @@ export async function createConfig(
|
||||
},
|
||||
output: {
|
||||
path: paths.targetDist,
|
||||
publicPath: validBaseUrl.pathname,
|
||||
publicPath: `${publicPath}/`,
|
||||
filename: isDev ? '[name].js' : 'static/[name].[fullhash:8].js',
|
||||
chunkFilename: isDev
|
||||
? '[name].chunk.js'
|
||||
|
||||
Reference in New Issue
Block a user