-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
75 lines (70 loc) · 1.79 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
var path = require("path");
var DIST_DIR = path.resolve(__dirname, "dist");
var SRC_DIR = path.resolve(__dirname, "src");
const HOST = process.env.HOST || '0.0.0.0';
const PORT = process.env.PORT || '8770';
var config = {
entry: SRC_DIR + "/app/index.js",
output: {
path: DIST_DIR + "/app",
filename: "bundle.js",
publicPath: "/app/"
},
module: {
loaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['react']
}
},
{
test: /\.html?$/,
exclude: /node_modules/,
loader: 'html-loader'
},
{
test: /\.css?$/,
exclude: /node_modules/,
loader: 'style-loader'
},
{
test: /\.css?$/,
exclude: /node_modules/,
loader: 'css-loader'
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file-loader?hash=sha512&digest=hex&name=[hash].[ext]',
'image-webpack-loader?{gifsicle: {interlaced: true}, optipng: {optimizationLevel: 7}, pngquant:{quality: "65-90", speed: 4}, mozjpeg: {quality: 65}}'
]
}
]
},
devServer: {
contentBase: './src',
// do not print bundle build stats
noInfo: true,
// enable HMR
hot: true,
// embed the webpack-dev-server runtime into the bundle
inline: true,
// serve index.html in place of 404 responses to allow HTML5 history
historyApiFallback: true,
port: PORT,
host: HOST,
disableHostCheck: true,
proxy: [
{
context: ['/WalletService/**'],
target: 'http://localhost:8080',
secure: false,
changeOrigin: true,
},
],
},
};
module.exports = config;