-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
71 lines (68 loc) · 1.72 KB
/
server.js
File metadata and controls
71 lines (68 loc) · 1.72 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
'use strict';
let htmlWebpackPlugin = require('html-webpack-plugin');
let webpack = require('webpack');
let fs =require('fs');
let defaultSettings = require('./cfg/defaults');
require('./mock/server');
let config = {
entry:{
app:'./src/app.js',
vendor: [
"jquery",
"font-awesome-webpack",
"bootstrap-loader",
"angular",
'angular-ui-router',
'oclazyload',
'./src/common/lib/angular-toastr/index',
'./src/common/lib/angular-bootstrap/index',
'angular-file-upload'
]
},
output:{
path:__dirname+'/dist/',
filename: "script/[name].[hash:6].js",
jsonpFunction:'Topthinking',
chunkFilename: "script/[name].[chunkhash:6].js"
},
devServer:{
historyApiFallback:true,
hot:true,
inline:true,
progress:true,
port:defaultSettings.port,
proxy: {
'**/*': {
target: 'htstp://localhost:3000',
pathRewrite:JSON.parse(fs.readFileSync('./rewrite.json')),
secure: false
}
}
},
resolve:{
root:__dirname+'./src/'
},
plugins: [
new htmlWebpackPlugin({
chunks: ['app', 'vendor'],
favicon:'./src/favicon.ico',
template:'./src/app.html',
filename:'index.html',
inject:'body',
minify:{
removeEmptyAttributes: true,
removeAttributeQuotes: true,
collapseBooleanAttributes: true,
collapseWhitespace: true
}
}),
new webpack.ProvidePlugin({
$:'jquery',
jQuery:"jquery",
"window.jQuery":"jquery"
}),
new webpack.optimize.CommonsChunkPlugin('vendor', 'script/vendor.[hash:6].js')
],
module: defaultSettings.getDefaultModules()
};
module.exports = config;