-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
41 lines (40 loc) · 1019 Bytes
/
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
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var extractCSS = new ExtractTextPlugin('bundle.css');
var precss = require('precss');
var autoprefixer = require('autoprefixer');
module.exports = {
entry: [
'./app.js'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: 'dist'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
extractCSS
],
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel'],
}, {
test: /\.less/,
loader: extractCSS.extract(
'style', 'css!postcss?sourceMap=inline!less'
)
}, {
test: /\.(png|jpg|ttf|woff|svg|otf|eot|svg).*?$/,
loader: 'file-loader'
}]
},
postcss: function () {
return [precss, autoprefixer({ browsers: ['last 2 versions']})];
}
};