-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
46 lines (39 loc) · 1.16 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
var BundleTracker = require('webpack-bundle-tracker')
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var path = require('path');
var webpack = require('webpack');
var resolve = path.resolve.bind(path, __dirname);
configuration = {
contex: __dirname,
devtool: 'source-map',
entry: './assets/js/main',
output: {
path: resolve('assets/bundles/'),
filename: '[name].js',
publicPath: '/static/bundles/'
},
module: {
loaders: [
{test: /\.js$/, exclude: /node_modules/, loaders: ['babel']},
{test: /\.scss$/, loader: ExtractTextPlugin.extract(['css?sourceMap', 'sass'])},
{test: /\.woff$/, loader: "file?name=[name].[ext]"},
{test: /\.mp3$/, loader: 'file?name=[name].[ext]'},
{test: /\.(png|jpg)$/, loader: 'url-loader'},
{
test: /\.(eot|otf|png|svg|ttf|woff|woff2)(\?v=[0-9.]+)?$/,
loader: 'file?name=[name].[ext]',
include: [
resolve('node_modules')
]
}
]
},
plugins: [
new BundleTracker({filename: './webpack-stats.json'}),
new ExtractTextPlugin('[name].css')
],
sassLoader: {
sourceMap: true
}
};
module.exports = configuration;