Files
awx/awx/ui/build/webpack.watch.js
gconsidine c57c17546e Update UI build system
* Faster build times
* Smaller bundle sizes
* Adjust paths
* Cleanup npm dependencies
* Remove unneded Grunt tasks
2017-09-07 18:09:14 -04:00

44 lines
1.2 KiB
JavaScript

const path = require('path');
const _ = require('lodash');
const webpack = require('webpack');
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
const TARGET_PORT = _.get(process.env, 'npm_package_config_django_port', 8043);
const TARGET_HOST = _.get(process.env, 'npm_package_config_django_host', 'https://localhost');
const TARGET = `https://${TARGET_HOST}:${TARGET_PORT}`;
const STATIC_URL = '/static/';
let development = require('./webpack.development');
let watch = {
plugins: [
new HtmlWebpackHarddiskPlugin(),
new webpack.HotModuleReplacementPlugin()
],
devServer: {
contentBase: path.resolve(__dirname, '..', 'static'),
publicPath: STATIC_URL,
clientLogLevel: 'info',
host: '127.0.0.1',
port: 3000,
proxy: {
'/': {
target: TARGET,
secure: false,
ws: false
},
'/websocket': {
target: TARGET,
secure: false,
ws: true
}
}
}
};
watch.plugins = development.plugins.concat(watch.plugins)
module.exports = _.merge(development, watch);