1 | var path = require('path');
|
2 | var webpack = require('webpack');
|
3 | var PROD = (process.env.NODE_ENV === "production");
|
4 | module.exports = {
|
5 | entry: {
|
6 | "collar-dev-tool": './src/client/index.js'
|
7 | },
|
8 | output: {
|
9 | path: path.join(__dirname, "public", "js"),
|
10 | filename: '[name].js'
|
11 | },
|
12 | module: {
|
13 | rules: [
|
14 | {
|
15 | test: /\.js$/,
|
16 | exclude: /(node_modules|bower_components)/,
|
17 | use: [
|
18 | {
|
19 | loader: 'babel-loader',
|
20 | options: { presets: ['es2015'] }
|
21 | }
|
22 | ]
|
23 | }
|
24 | ]
|
25 | },
|
26 | plugins: PROD ? [
|
27 | new webpack.optimize.UglifyJsPlugin({
|
28 | compress: { warnings: false }
|
29 | })
|
30 | ] : [
|
31 |
|
32 |
|
33 | ],
|
34 | devServer: {
|
35 | contentBase: [
|
36 | path.join(__dirname, 'public')
|
37 | ],
|
38 | hot: true,
|
39 | inline: true,
|
40 | port: 8080,
|
41 | proxy: {
|
42 | '*': {
|
43 | target: 'http://localhost:7500',
|
44 | secure: false
|
45 | }
|
46 | }
|
47 | }
|
48 | };
|