-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
66 lines (65 loc) · 1.77 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
64
65
66
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: './app/app.js',
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
module: {
preLoaders: [
{
test: /\.js$/,
loader: 'eslint-loader',
exclude: /node_modules/
}
],
loaders: [
{
test: /\.js$/,
loader: 'ng-annotate?add=true!babel',
exclude: /node_modules/
},
{
test: /.html$/,
loader: 'ngtemplate?relativeTo=' + __dirname +'/app!html?root=' + __dirname + '/app'
},
{
test: /\.scss$/,
loaders: ['style', 'css?root=' + __dirname + '/app', 'autoprefixer-loader?browsers=last 2 versions', 'sass'],
},
{
test: /\.png$/,
loader: 'file-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
},
{
test: /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
loader: 'file-loader',
}
]
},
plugins: [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({ minimize: true, output: { comments: false }}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
})
],
resolve: {
root: path.resolve('app/'),
extensions: ['', '.js']
},
eslint: {
failOnError: true
},
sassLoader: {
includePaths: [path.resolve(__dirname, "./app")]
},
devtool: '#source-map'
};