-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.vendor.js
62 lines (61 loc) · 1.52 KB
/
webpack.config.vendor.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 ExtractTextPlugin = require('extract-text-webpack-plugin');
const extractCSS = new ExtractTextPlugin('vendor.css');
const isDevelopment = process.env.NODE_ENV !== 'production';
module.exports = {
resolve: {
extensions: ['.js'],
},
module: {
rules: [
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' },
{ test: /\.s?css$/i, loader: extractCSS.extract(['css-loader?minimize', 'sass-loader']) },
{ test: /\.json$/, loader: 'json-loader' },
],
},
entry: {
vendor: [
'babel-polyfill',
'font-awesome/scss/font-awesome.scss',
'bootstrap/scss/bootstrap.scss',
'jquery',
'tether',
'bootstrap/dist/js/bootstrap',
'history',
'react',
'react-dom',
'redux',
'react-redux',
'react-router',
'react-router-dom',
'react-router-redux',
'redux-thunk',
'classnames',
'mirror-keys',
],
},
output: {
path: path.resolve('./dist'),
filename: '[name].js',
library: '[name]_[hash]',
},
plugins: [
extractCSS,
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
jquery: 'jquery',
Tether: 'tether',
}),
new webpack.DllPlugin({
path: path.join(__dirname, 'dist', '[name]-manifest.json'),
name: '[name]_[hash]',
})
].concat(isDevelopment ? [] : [
new webpack.optimize.UglifyJsPlugin({
beautify: false,
comments: false,
}),
]),
};