-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
95 lines (85 loc) · 2.25 KB
/
webpack.config.js
File metadata and controls
95 lines (85 loc) · 2.25 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
var webpack = require('webpack'),
HtmlWebpackPlugin = require('html-webpack-plugin'),
path = require('path'),
appConfig = require('./app.config.js');
module.exports = {
entry: {
index: './src/index',
styles: './src/main',
vendor: ['jquery', 'angular', 'angular-ui-router', 'lodash', 'restangular']
},
output: {
path: path.join(__dirname, '/build'),
filename: '[name].js'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'ng-annotate!babel',
exclude: [/node_modules/]
}, {
test: /\.html$/,
loader: 'html',
exclude: [/node_modules/]
},
{
test: /main\.scss$/,
loader: 'style!css!sass?outputStyle=expanded'
},
//Bootstrap support
{
test: /\.css$/,
loader: 'css'
}, {
test: /\.(woff|woff2)/,
loader: 'url-loader?limit=10000&minetype=application/font-woff'
}, {
test: /\.ttf$/,
loader: 'file-loader'
}, {
test: /\.eot$/,
loader: 'file-loader'
}, {
test: /\.svg$/,
loader: 'file-loader'
},
//images
{
test: /\.(png)/,
loader: 'url-loader?limit=10000&minetype=image/png'
}
],
// Put paths to files in here which are already packaged for production, such as vendor
// libs that have been minimized already. This is going to bypass any checks on our end
noParse: []
},
resolve: {
// what kind of files types do we except? this will auto check for only these file types
// against your path
extensions: ['', '.js', '.json', '.scss'],
// The directories to look in
modulesDirectories: ['node_modules', 'src'],
// create a shortend name for something used everywhere, like our main module
alias: {
module: 'module.js'
}
},
plugins: [
new HtmlWebpackPlugin({
title: appConfig.name.replace(/\s/g, ''),
template: 'index.html',
inject: true
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'vendor.bundle.js'
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
_: 'lodash'
})
]
// create and inject source maps on our build
// devtool: 'source-map'
};