-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathwebpack.production.config.js
39 lines (38 loc) · 1.16 KB
/
webpack.production.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
import path from 'path';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import webpack from 'webpack';
export default {
devtool: 'source-map',
entry: ['./src/index'],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel',
include: path.join(__dirname, 'src')
}, {
test: /\.styl$/,
/* eslint-disable max-len */
loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!autoprefixer-loader!stylus-loader')
/* eslint-enable max-len */
}, {
test: /\.woff$/,
loader: 'file-loader?name=font/[name].[ext]?[hash]'
}, {
test: /\.png$/,
loader: 'file-loader?name=images/[name].[ext]?[hash]'
}, {
test: /\.md$/,
loader: 'html!markdown'
}]
},
plugins: [
new ExtractTextPlugin('styles.css', { allChunks: false }),
new webpack.optimize.UglifyJsPlugin({ minimize: true }),
new HtmlWebpackPlugin({ template: 'src/index.html', inject: 'body' })
]
};