2018-09-25 17:39:21 +03:00
const webpack = require ( 'webpack' ) ;
2018-09-27 01:06:30 +03:00
const TARGET _PORT = 8043 ;
const TARGET = ` https://localhost: ${ TARGET _PORT } ` ;
2018-09-25 17:39:21 +03:00
module . exports = {
entry : './src/index.js' ,
module : {
rules : [
{
test : /\.(js|jsx)$/ ,
exclude : /node_modules/ ,
use : [ 'babel-loader' ]
2018-10-11 18:31:37 +03:00
} ,
{
test : /\.s?[ac]ss$/ ,
use : [
{ loader : 'style-loader' } ,
{ loader : 'css-loader' } ,
{
loader : 'sass-loader' ,
options : {
includePaths : [
'node_modules/patternfly/dist/sass' ,
'node_modules/patternfly/node_modules/bootstrap-sass/assets/stylesheet' ,
'node_modules/patternfly/node_modules/font-awesome-sass/assets/stylesheets'
]
}
}
]
} ,
{
test : /\.(woff(2)?|ttf|jpg|png|eot|gif|svg)(\?v=\d+\.\d+\.\d+)?$/ ,
use : [ {
loader : 'file-loader' ,
options : {
name : '[name].[ext]' ,
outputPath : 'fonts/' ,
publicPatH : '../'
}
} ]
2018-09-25 17:39:21 +03:00
}
]
} ,
resolve : {
2018-10-11 18:31:37 +03:00
extensions : [ '*' , '.js' , '.jsx' , '.css' ]
2018-09-25 17:39:21 +03:00
} ,
output : {
path : _ _dirname + '/dist' ,
publicPath : '/' ,
filename : 'bundle.js'
} ,
plugins : [
new webpack . HotModuleReplacementPlugin ( )
] ,
devServer : {
contentBase : './dist' ,
hot : true ,
inline : true ,
stats : 'minimal' ,
host : '127.0.0.1' ,
https : true ,
2018-09-27 01:11:29 +03:00
port : 3001 ,
2018-09-25 17:39:21 +03:00
clientLogLevel : 'none' ,
proxy : [
{
context : '/api/login/' ,
target : TARGET ,
secure : false ,
ws : false ,
headers : {
Host : ` localhost: ${ TARGET _PORT } ` ,
Origin : TARGET ,
Referer : ` ${ TARGET } / `
}
} ,
{
context : '/api' ,
target : TARGET ,
secure : false ,
ws : false ,
bypass : req => ( req . originalUrl . includes ( 'hot-update.json' ) || req . originalUrl . includes ( 'login' ) ) ,
} ,
{
context : '/websocket' ,
target : TARGET ,
secure : false ,
ws : true
} ]
}
} ;