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:
parent
2b984d45b2
commit
14dedc4015
@ -116,7 +116,7 @@ const config = {
|
|||||||
type: 'asset/resource',
|
type: 'asset/resource',
|
||||||
generator: {
|
generator: {
|
||||||
filename: '[name][ext]',
|
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') {
|
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 = {
|
config.devServer = {
|
||||||
port: 9006,
|
https: url.protocol === 'https',
|
||||||
|
host: url.hostname,
|
||||||
|
port: url.port,
|
||||||
devMiddleware: {
|
devMiddleware: {
|
||||||
writeToDisk: false,
|
writeToDisk: false,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user