-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathwebpack.config.js
60 lines (48 loc) · 1.25 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var webpack = require('webpack'),
autoprefixer = require('autoprefixer'),
ExtractTextPlugin = require("extract-text-webpack-plugin"),
path = require('path'),
ProgressBarPlugin = require('progress-bar-webpack-plugin');
module.exports = {
context: __dirname,
entry: {
web: __dirname + "/src/web/index.js",
},
resolve: {
root: path.resolve('./src'),
extensions: ['', '.js']
},
devtool: 'source-map',
cache: true,
module: {
loaders: [
{ test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader!postcss") },
{ test: /\.less$/, loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader!postcss") },
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
include: (__dirname + '/src'),
loader: 'babel', // 'babel-loader' is also a legal name to reference
query: {
presets: ['stage-1', 'es2015', 'react']
}
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file?name=fonts/[name].[ext]'
}
]
},
output: {
path: __dirname + '/public/assets/',
filename: 'web.js'
},
postcss: [ autoprefixer({ browsers: ['last 2 versions'] }) ],
plugins: [
new ExtractTextPlugin("web.css"),
new ProgressBarPlugin()
],
stats: {
children: false
}
};