-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
52 lines (52 loc) · 1.55 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
var path = require('path');
var webpack = require('webpack');
var extractTextWebpackPlugin = require('extract-text-webpack-plugin');
module.exports = {
context: path.resolve('app'),
entry: {
app: ['./app.js'],
vendor: ['jquery', 'angular', 'underscore']
},
output: {
filename: 'app.bundle.js',
path: path.resolve('build'),
publicPath: '/assets'
},
module: {
loaders: [
{
test: /\.(es6|js)$/,
loader: 'babel!' + path.resolve('./app/custom-loaders/authorInfo.js'),
exclude: /(node_modules)/
},
{
test: /\.css$/,
loader: extractTextWebpackPlugin.extract("style-loader", "css-loader!" + path.resolve('./app/custom-loaders/authorInfo.js')),
exclude: /(node_modules)/
},
{
test: /\.less$/,
loader: 'style-loader!css-loader!less-loader',
exclude: /(node_modules)/
},
{
test: /\.(png|jpg)$/i,
loader: 'url-loader',
query: {
limit: 1000
},
exclude: /(node_modules)/
}
]
},
plugins: [
new extractTextWebpackPlugin("app.css"),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js', Infinity)
],
resolve: {
extensions: ['', '.js', '.es6'],
alias: {
'ui-grid': '../node_modules/angular-ui-grid'
}
}
}