-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.production.js
More file actions
38 lines (37 loc) · 1.03 KB
/
webpack.production.js
File metadata and controls
38 lines (37 loc) · 1.03 KB
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
var webpack = require('webpack');
var path = require('path');
var autoprefixer = require('autoprefixer');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
'./src/js/index.js',
'./src/scss/style.scss'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
plugins: [
new ExtractTextPlugin('app.css'),
new HtmlWebpackPlugin({
template: './src/index.jade'
}),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
],
module: {
loaders: [
{ test: /\.js$/, loaders: ['babel'], exclude: /node_modules/ },
{ test: /\.jade$/, loader: 'jade' },
{ test: /\.(scss|css)$/, loader: ExtractTextPlugin.extract('style', 'css!sass!postcss') },
{ test: /\.(png|jpg|gif|svg|woff|woff2|eot|ttf)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url?limit=500000' }
]
},
postcss: [
autoprefixer({ browsers: ['last 2 versions'] })
]
}