-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
68 lines (64 loc) · 2.05 KB
/
webpack.config.js
File metadata and controls
68 lines (64 loc) · 2.05 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
var webpack = require('webpack');
const path = require("path");
var ChunkHashReplacePlugin = require('chunkhash-replace-webpack-plugin');
var WebpackMd5Hash = require('webpack-md5-hash');
var ManifestPlugin = require('webpack-manifest-plugin');
var node_dir = __dirname + '/node_modules';
var HtmlWebpackPlugin = require('html-webpack-plugin');
var InlineManifestWebpackPlugin=require('inline-manifest-webpack-plugin');
module.exports = {
context: __dirname + '/app',
entry: {
app: './app.js',
vendor: ['angular', 'underscore', 'restangular', 'angular-ui-router', 'bootstrap', 'angular-ui-bootstrap', 'angular-animate', 'angular-sanitize','angular-material']
},
output: {
path: path.join(__dirname, "js"),
filename: "[name].bundle.js"
// filename: "[name].[chunkhash].bundle.js"
},
plugins: [
function() {
this.plugin("done", function(stats) {
require("fs").writeFileSync(
path.join(__dirname, "js", "stats.json"),
JSON.stringify(stats.toJson()));
});
},
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
}),
new webpack.ProvidePlugin({
_: "underscore",
underscore: "underscore"
}),
new webpack.optimize.CommonsChunkPlugin({
name: ["vendor"], // vendor libs + extracted manifest
minChunks: Infinity
}),
new ManifestPlugin({
filename: "chunk-manifest.json",
manifestVariable: "webpackManifest"
}),
new WebpackMd5Hash(),
new InlineManifestWebpackPlugin({
name: 'webpackManifest'
})
,
new HtmlWebpackPlugin({
title: 'Wound Care Portal',
template: 'index.ejs',
filename:'../index.html'
})
],
devServer: {
inline: true,
port:9001
},
resolve: {
alias: {
"underscore": node_dir + "/underscore/underscore-min.js"
}
}
};