-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwebpack.config.js
55 lines (52 loc) · 1.31 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
/**
* Created by jeffersonmourak on 21/5/17.
*/
const webpack = require('webpack');
const path = require('path');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
var BUILD_DIR = path.resolve(__dirname, 'dist/');
var SRC_DIR = path.resolve(__dirname, 'src/');
var config = {
resolve: {
alias: {
'@components': path.resolve(SRC_DIR, 'components'),
'@translations': path.resolve(SRC_DIR, 'translations')
}
},
entry: {
"jhs": ['babel-polyfill' ,SRC_DIR + '/index.js'],
"jhs.min": ['babel-polyfill' ,SRC_DIR + '/index.js'],
},
devtool: "source-map",
output: {
path: BUILD_DIR,
filename: '[name].js'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true
}),
new webpack.HotModuleReplacementPlugin()
],
module : {
loaders : [
{
test : /\.js?/,
include : SRC_DIR,
loader : 'babel-loader'
}
]
},
devServer: {
contentBase: __dirname,
publicPath: '/dist/',
compress: true,
hot: true,
port: 3000,
watchContentBase: true,
open: true,
historyApiFallback: path.join(__dirname, 'index.html'),
}
};
module.exports = config;