mirror of
https://github.com/valitydev/redash.git
synced 2024-11-06 17:15:17 +00:00
Make webpack-dev-server config more modular
This commit is contained in:
parent
681fd213da
commit
7e986db979
@ -6,6 +6,7 @@ var ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
var WebpackBuildNotifierPlugin = require('webpack-build-notifier');
|
||||
var path = require('path');
|
||||
|
||||
var redashBackend = process.env.REDASH_BACKEND || 'http://localhost:5000';
|
||||
|
||||
var config = {
|
||||
entry: {
|
||||
@ -82,25 +83,41 @@ var config = {
|
||||
historyApiFallback: true,
|
||||
proxy: {
|
||||
'/login': {
|
||||
target: 'http://localhost:5000/',
|
||||
target: redashBackend + '/',
|
||||
secure: false
|
||||
},
|
||||
'/images': {
|
||||
target: redashBackend + '/',
|
||||
secure: false
|
||||
},
|
||||
'/js': {
|
||||
target: redashBackend + '/',
|
||||
secure: false
|
||||
},
|
||||
'/styles': {
|
||||
target: redashBackend + '/',
|
||||
secure: false
|
||||
},
|
||||
'/status.json': {
|
||||
target: 'http://localhost:5000/',
|
||||
target: redashBackend + '/',
|
||||
secure: false
|
||||
},
|
||||
'/api/admin': {
|
||||
target: 'http://localhost:5000/',
|
||||
target: redashBackend + '/',
|
||||
secure: false
|
||||
},
|
||||
'/api': {
|
||||
target: 'http://localhost:5000',
|
||||
target: redashBackend,
|
||||
secure: false
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (process.env.DEV_SERVER_HOST) {
|
||||
config.devServer.host = process.env.DEV_SERVER_HOST;
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
config.output.path = __dirname + '/client/dist';
|
||||
config.plugins.push(new webpack.optimize.UglifyJsPlugin());
|
||||
|
Loading…
Reference in New Issue
Block a user