Repository navigation
Expand file tree
/
Copy pathwebpack.config.js
More file actions
64 lines (63 loc) · 1.74 KB
/
Copy pathwebpack.config.js
File metadata and controls
64 lines (63 loc) · 1.74 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require('path');
var webpack = require('webpack');
module.exports = {
context : __dirname,
entry: {
path: path.resolve(__dirname, './src/app/index.jsx'),
vendors: ['react']
},
output: {
path: path.join(__dirname, './build'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.jsx$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.scss$/,
loaders: ["style", "css", "sass"]
},
{
test: /\.css$/,
loader: 'style!css?modules'
},
{
test: /\.(svg)$/,
loader: 'file-loader?name=./images/[name].[ext]',
include: /images/
},
{
test: /\.less$/,
loader: "style!css!less",
include: /node_modules/
},
{
test: /\.(otf|ttf|eot|svg|woff|woff2)(\?\S*)?$/,
loader: "file-loader?name=./font/[name]-[hash].[ext]",
include: /font/
}
]
},
resolve: {
extensions: ['', '.jsx', '.js', '.scss', '.less', '.json']
},
plugins: [
new ExtractTextPlugin("styles.css"),
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
]
};