-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
62 lines (59 loc) · 1.82 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
const path = require('path');
const webpack = require('webpack')
const VENDOR_LIBS = [
'redux', 'react-redux', 'react-dom'
]
module.exports = {
entry: {
realEstate: './assets/js/realEstate/realEstate.js',
// regularJS: './assets/js/regularJS.js',
vendor: VENDOR_LIBS
},
output: { filename: '[name].js',
path: path.resolve(__dirname, 'public/js/components') },
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: [
[ 'es2015', { modules: false } ],
'stage-0', 'react'
]
}
},
{
test: /\.scss$/,
use: [{
loader: "style-loader"
}, {
loader: "css-loader", options: {
sourceMap: true
}
}, {
loader: "sass-loader", options: {
sourceMap: true
}
}]
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module) {
// this assumes your vendor imports exist in the node_modules directory
return module.context && module.context.indexOf('node_modules') !== -1;
}
}),
// new webpack.optimize.UglifyJsPlugin({
// sourceMap: options.devtool && (options.devtool.indexOf("sourcemap") >= 0 || options.devtool.indexOf("source-map") >= 0)
// }),
// new webpack.Define
// new webpack.optimize.CommonsChunkPlugin({
// name: 'manifest' //But since there are no more common modules between them we end up with just the runtime code included in the manifest file
// })
]
};