-
Notifications
You must be signed in to change notification settings - Fork 3
/
webpack.config.js
41 lines (34 loc) · 1.16 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
var getConfig = require('hjs-webpack');
module.exports = getConfig({
in : 'src/index.js',
out: 'public',
isDev : process.env.NODE_ENV !== 'production',
output : {
hash: true
},
devServer: {
hot: true,
historyApiFallback: true,
info: true
},
clearBeforeBuild: true,
html: function (data) {
// here we return an object where each key is a file to be generated
return {
'index.html': [
'<html>',
'<head>',
'<link href="' + data.css + '" rel="stylesheet" type="text/css" />',
'<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">',
'</head>',
'<body>',
'<div id="root"></div>',
'<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>',
'<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>',
'<script src="' + data.main + '"></script>',
'</body>',
'</html>'
].join('')
}
}
});