-
Notifications
You must be signed in to change notification settings - Fork 25
/
webpack.production.config.js
41 lines (35 loc) · 1.21 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
40
41
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
/**
* This is the Webpack configuration file for production.
*/
module.exports = {
entry: "./src/app",
output: {
path: __dirname + "/build/",
filename: "app.js"
},
plugins: [
new ExtractTextPlugin('style.css', { allChunks: true })
],
module: {
loaders: [
{ test: /\.jsx?$/, exclude: /node_modules/, loaders: ["react-hot", "babel-loader?stage=0"] },
{ test: /\.css$/, loader: "style!css" },
{ test: /\.less$/, loader: 'style!css!less' },
{ test: /\.scss$/, loader: 'style!css!sass' },
{ test: /\.woff(2)?(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/octet-stream" },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file" },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=image/svg+xml" },
{ test: /\.(png|jpg|jpeg|gif)$/, loader: 'url-loader?limit=10000' }
]
},
resolve: {
extensions: ['', '.js', '.jsx', '.css']
},
postcss: [
require('autoprefixer'),
require('postcss-nested')
]
}