Доконфижил вебпак для работы с беком апишки

This commit is contained in:
SleepWalker
2016-02-06 14:43:57 +02:00
parent 86ad671194
commit bc6dacf446
4 changed files with 25 additions and 2 deletions

View File

@@ -30,8 +30,15 @@ var isTest = process.argv.some(function(arg) {
process.env.NODE_ENV = JSON.stringify(isProduction ? 'production' : 'development');
const API_HOST = 'http://account.l';
const CSS_CLASS_TEMPLATE = isProduction ? '[hash:base64:5]' : '[path][name]-[local]';
var config;
try {
config = require('./config/dev.json');
} catch (err) {
console.error('\n\n===\nPlease create dev.json config under ./config based on template.dev.json\n===\n\n');
throw err;
}
var webpackConfig = {
entry: {
@@ -72,7 +79,10 @@ var webpackConfig = {
port: 8080,
proxy: {
'/api*': {
target: API_HOST
headers: {
host: config.apiHost.replace(/https?:|\//g, '')
},
target: config.apiHost
}
},
hot: true,