Webpack: fix devServer with subdirectory
This commit is contained in:
parent
5eafa61760
commit
46baa4119f
1 changed files with 4 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
// Note: You must restart bin/webpack-dev-server for changes to take effect
|
// Note: You must restart bin/webpack-dev-server for changes to take effect
|
||||||
console.log('Running in development mode'); // eslint-disable-line no-console
|
console.log('Running in development mode'); // eslint-disable-line no-console
|
||||||
|
|
||||||
|
const { join } = require('path');
|
||||||
const { merge } = require('webpack-merge');
|
const { merge } = require('webpack-merge');
|
||||||
const sharedConfig = require('./shared');
|
const sharedConfig = require('./shared');
|
||||||
|
|
||||||
|
@ -10,6 +11,8 @@ const backendUrl = process.env.BACKEND_URL || 'http://localhost:4000';
|
||||||
const patronUrl = process.env.PATRON_URL || 'http://localhost:3037';
|
const patronUrl = process.env.PATRON_URL || 'http://localhost:3037';
|
||||||
const secureProxy = !(process.env.PROXY_HTTPS_INSECURE === 'true');
|
const secureProxy = !(process.env.PROXY_HTTPS_INSECURE === 'true');
|
||||||
|
|
||||||
|
const { FE_SUBDIRECTORY } = require(join(__dirname, '..', 'app', 'soapbox', 'build_config'));
|
||||||
|
|
||||||
const backendEndpoints = [
|
const backendEndpoints = [
|
||||||
'/api',
|
'/api',
|
||||||
'/pleroma',
|
'/pleroma',
|
||||||
|
@ -76,6 +79,7 @@ module.exports = merge(sharedConfig, {
|
||||||
hot: false,
|
hot: false,
|
||||||
historyApiFallback: {
|
historyApiFallback: {
|
||||||
disableDotRule: true,
|
disableDotRule: true,
|
||||||
|
index: join(FE_SUBDIRECTORY, '/'),
|
||||||
},
|
},
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
|
|
Loading…
Reference in a new issue