-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
76 lines (73 loc) · 2.44 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
67
68
69
70
71
72
73
74
75
76
/* global __dirname */
module.exports = (function() {
'use strict';
var path = require("path");
var webpack = require("webpack");
var AngularWebpackPlugin = require('angular-webpack-plugin');
var NgAnnotatePlugin = require('ng-annotate-webpack-plugin');
var clientDir = path.resolve(__dirname, path.join(__dirname, 'client'));
return {
entry: {
bootstrap: [
"./client/entry.js"
]
},
output: {
path: path.join(__dirname, 'client', "assets"),
publicPath: "assets/",
filename: "[name].js",
chunkFilename: "[chunkhash].js"
},
module: {
noParse: [
// /angular-translate(\/|\\)angular-translate\.js/,
],
loaders: [{
test: /\.css$/,
loader: "style-loader!css-loader"
}, {
test: /\.json$/,
loader: "json"
}, {
test: /images(\/|\\).*\.svg$/,
loader: "url-loader"
}, {
test: /modernizr\.js$/,
loader: 'imports?this=>window'
}, {
test: /respond\.src\.js$/,
loader: 'imports?this=>window'
}, {
test: /ng-table\.js/,
loader: 'imports?define=>null'
}, {
test: /templates(\/|\\).*\.html$/,
loader: "ngtemplate?relativeTo=" + clientDir + "!html"
}, {
test: /\.less$/,
loader: "style-loader!css-loader!less-loader"
}]
},
resolve: {
root: [
path.resolve('bower_components')
],
alias: {
'pascalprecht.translate': 'angular-translate',
'uiGmapgoogle-maps': 'angular-google-maps/dist/angular-google-maps.js',
'btford.modal': "angular-modal",
'ngSanitize': 'angular-sanitize',
"ng": "angular-translate" // workaround for missing ng-module - this loads angular-translate twice :(
}
},
plugins: [
new AngularWebpackPlugin(),
new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])
),
new NgAnnotatePlugin({
add: true
})
]
};
})();