forked from smelukov/loftschool-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
40 lines (38 loc) · 1.01 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
let webpack = require('webpack');
let HtmlPlugin = require('html-webpack-plugin');
let CleanWebpackPlugin = require('clean-webpack-plugin');
let ExtractTextPlugin = require('extract-text-webpack-plugin');
let loaders = require('./webpack.config.loaders')();
let path = require('path');
loaders.push({
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader'
})
});
module.exports = {
entry: './src/index.js',
output: {
filename: '[hash].js',
path: path.resolve('dist')
},
devtool: 'source-map',
module: {
loaders
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
drop_debugger: false
}
}),
new ExtractTextPlugin('styles.css'),
new HtmlPlugin({
title: 'Loft School sample project',
template: 'index.hbs'
}),
new CleanWebpackPlugin(['dist'])
]
};