feat: allow dev server port configuration from CLI
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
const merge = require('webpack-merge');
|
||||
const config = require('./webpack.config.js');
|
||||
|
||||
module.exports = merge(config, {
|
||||
mode: 'development',
|
||||
devServer: {
|
||||
publicPath: '/dist/',
|
||||
proxy: {
|
||||
'/extensions': {
|
||||
target: 'http://localhost:3001',
|
||||
pathRewrite: { '^/extensions': '/public/extensions' }
|
||||
}
|
||||
},
|
||||
port: 3001
|
||||
}
|
||||
});
|
||||
module.exports = (_env, argv) => {
|
||||
const port = argv.port || 3001;
|
||||
return merge(config, {
|
||||
mode: 'development',
|
||||
devServer: {
|
||||
publicPath: '/dist/',
|
||||
proxy: {
|
||||
'/extensions': {
|
||||
target: `http://localhost:${port}`,
|
||||
pathRewrite: { '^/extensions': '/public/extensions' }
|
||||
}
|
||||
},
|
||||
port,
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user