-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
50 lines (46 loc) · 1.11 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
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var minimize = process.argv.indexOf('--minimize') !== -1;
var jsOutput = 'wood.js';
var cssOutput = 'wood.css';
var plugins = [
new webpack.NoErrorsPlugin()
];
if (minimize) {
jsOutput = 'wood.min.js';
cssOutput = 'wood.min.css';
plugins.push(new webpack.optimize.UglifyJsPlugin());
}
plugins.push(new ExtractTextPlugin('css/' + cssOutput));
module.exports = {
entry: './src/main.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'js/' + jsOutput
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: 'es2015'
}
}, {
test: /\.(woff|woff2|eot|ttf|truetype|svg)$/,
loader: 'url-loader?limit=1024&name=../fonts/[name].[ext]'
}, {
test: /\.scss$/,
loader: ExtractTextPlugin.extract(
'style',
'css!sass')
}]
},
plugins: plugins,
stats: {
// Nice colored output
colors: true
},
// Create Sourcemaps for the bundle
devtool: 'source-map'
};