-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathserver.js
56 lines (53 loc) · 1.36 KB
/
server.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
'use strict';
let htmlWebpackPlugin = require('html-webpack-plugin');
let webpack = require('webpack');
let defaultSettings = require('./config/defaults');
let path = require('path');
let config = {
entry:defaultSettings.getDefaultentry(),
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,
port:defaultSettings.port
},
plugins: [
new webpack.LoaderOptionsPlugin({
options:{
postcss:()=>{
return [
require('autoprefixer')({
"broswers":["last 5 versions"]
})
];
}
}
}),
new webpack.HotModuleReplacementPlugin(),
new htmlWebpackPlugin({
chunks: ['app', 'vendor'],
template:'./src/app.html',
favicon:'./src/app.jpg',
filename:'index.html',
inject:'body',
minify:{
removeEmptyAttributes: true,
removeAttributeQuotes: true,
collapseBooleanAttributes: true,
collapseWhitespace: true
}
}),
new webpack.optimize.CommonsChunkPlugin({
"name":"vendor",
"filename":"script/vendor.[hash:6].js"
})
],
module: defaultSettings.getDefaultModules()
};
module.exports = config;