-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
54 lines (45 loc) · 1.34 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
var webpack = require('webpack');
var ResolverPlugin = require("webpack/lib/ResolverPlugin");
var path = require('path');
var node_modules = path.resolve(__dirname,'node_modules');
var pathToAngular = path.resolve(node_modules,'angular/angular.js');
var APP = __dirname + '/src';
module.exports = {
resolveLoader: {
root: path.join(__dirname,'node_modules')
},
context : APP,
entry : {
app : ['webpack/hot/dev-server', './app.js']
},
devtool: 'source-map',
output: {
path: APP,
filename: 'bundle.js'
},
devServer: {
contentBase : './dist',
colors:true,
histroryApiFallback :true,
inline: true
},
plugins: [
new webpack.HotModuleReplacementPlugin()
],
module:{
loaders:[
{test: /\.js$/, loader: 'ng-annotate!babel?presets[]=es2015', exclude: /node_modules/},
{test: /[\/]angular\.js$/, loader: "exports?angular" },
{test: /\.tpl\.html$/, loader: 'raw'},
{test: /\.jpg$/, loader: 'file-loader'},
{test: /\.css$/, loader: 'style!css'},
{test: /\.less$/, loader: 'style!css!less'},
{test: /\.tpl\.html$/, loader: 'raw'}
]
},
resolve:{
alias:{
angular : __dirname+'/node_modules/angular/angular'
}
}
};