1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-27 08:31:20 +02:00

MM-47238 Add MM_BOARDS_DEV_SERVER_URL environment variable for MPA

This commit is contained in:
Harrison Healey 2022-10-17 14:33:48 -04:00
parent 2b984d45b2
commit 14dedc4015

View File

@ -116,7 +116,7 @@ const config = {
type: 'asset/resource',
generator: {
filename: '[name][ext]',
publicPath: TARGET_IS_PRODUCT ? 'http://localhost:9006/static/' : '/static/',
publicPath: '/static/',
}
},
],
@ -203,8 +203,18 @@ config.plugins.push(new webpack.DefinePlugin({
}));
if (NPM_TARGET === 'start:product') {
const url = new URL(process.env.MM_BOARDS_DEV_SERVER_URL ?? 'http://localhost:9006');
for (const rule of config.module.rules) {
if (rule.type === 'asset/resource' && rule.generator) {
rule.generator.publicPath = url.toString() + 'static/';
}
}
config.devServer = {
port: 9006,
https: url.protocol === 'https',
host: url.hostname,
port: url.port,
devMiddleware: {
writeToDisk: false,
},