-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
63 lines (54 loc) · 1.73 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
61
62
63
// Add WebPack to use the included CommonsChunkPlugin
var webpack = require('webpack');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var config = {
debug: true,
addVendor: function (name, path) {
this.resolve.alias[name] = path;
this.module.noParse.push(new RegExp(path));
},
entry: {
app: ['./frontend/src/main.js'],
vendors: [
'lodash',
'angular',
'angular-resource',
'angular-messages',
'angular-animate',
'angular-ui-router',
'satellizer',
'restangular',
'js-data',
'js-data-angular'
]
},
resolve: {
extensions: ['', '.js']
},
output: {
path: __dirname + '/frontend/static/scripts',
filename: "main.js"
},
module: {
loaders: [
{ test: /\.css/, loader: 'style!css' },
{ test: /\.less$/, loader: 'style!css!less' },
{ test: /\.jpe?g$|\.gif$|\.png$|\.wav$|\.mp3$/, loader: 'url' },
{ test: /\.svg$|\.woff$|\.woff2$|\.eot$|\.ttf$/, loader: 'url-loader?limit=100000' },
//{ test: /\.map/, loader: 'file-loader' }
//setup later for production
//{ test: /\.less$/, loader: ExtractTextPlugin.extract('style-loader', 'less-loader') }
]
},
plugins: [
// We add a plugin called CommonsChunkPlugin that will take the vendors chunk
// and create a vendors.js file. As you can see the first argument matches the key
// of the entry, "vendors"
new webpack.optimize.CommonsChunkPlugin('vendors', 'vendors.js'),
//setup later for production
//new ExtractTextPlugin("[name].css")
]
};
//config.addVendor('bootstrap', bower_dir + '/bootstrap/bootstrap.min.js');
//config.addVendor('bootstrap.css', bower_dir + '/bootstrap/bootstrap.min.css');
module.exports = config;