-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.babel.js
55 lines (51 loc) · 1.27 KB
/
webpack.config.babel.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
import webpack from 'webpack';
import path from 'path';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import CleanWebpackPlugin from 'clean-webpack-plugin';
const production = process.env.NODE_ENV === 'production';
const BUILD_DIR = path.resolve(__dirname, 'build');
const APP_DIR = path.resolve(__dirname, 'client');
const config = {
entry: path.join(APP_DIR + '/index.jsx'),
output: {
path: BUILD_DIR,
filename: 'bundle.js',
publicPath: "/"
},
plugins: [
new CopyWebpackPlugin([
{from: './index.html'}
]),
new CleanWebpackPlugin([
BUILD_DIR,
])
],
target: "web",
module: {
loaders: [
{
test: /\jsx?/,
include: APP_DIR,
loader: 'babel-loader',
query: {
presets: ['react', 'es2015']
}
},
{
test: /\less$/,
loader: "style-loader!css-loader!less-loader"
}
]
},
devtool: production? false : "source-map",
// debug: !production,
devServer: {
proxy: {
'/chat*': {
target: 'http://localhost:8080',
secure: false
}
}
}
};
export default config;