forked from web-izmerenie/avto-lux161
-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.base.js
44 lines (42 loc) · 1.04 KB
/
webpack.config.base.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
'use strict';
/*jshint esversion: 6 */
/*jshint node: true */
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
module.exports = (extractCss) => (config) => webpackMerge.smart({
devtool: 'source-map',
module: {
loaders: [
{ test: /\.ls$/, loader: 'livescript-loader' },
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.jade$/, loader: 'raw-loader' },
{ test: require.resolve('jquery'), loader: 'expose?$!expose?jQuery' },
{ test: /\.modernizrrc$/, loader: 'modernizr' },
{
test: /\.styl$/,
loader: extractCss.extract(
'style-loader',
'css-loader?sourceMap!stylus-loader'
)
}
]
},
stylus: {
use: [require('nib')(), require('bootstrap-styl')()]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ['app', 'vendor'],
minChunks: Infinity
})
].concat(
(process.env.NODE_ENV === 'production') ?
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_console: false,
unsafe: true
}
}) : []
)
}, config);