mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-01 20:31:49 -05:00
* Faster build times * Smaller bundle sizes * Adjust paths * Cleanup npm dependencies * Remove unneded Grunt tasks
44 lines
1.2 KiB
JavaScript
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);
|
|
|