-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwebpack.config.js
More file actions
37 lines (35 loc) · 847 Bytes
/
webpack.config.js
File metadata and controls
37 lines (35 loc) · 847 Bytes
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
const webpack = require("webpack");
const glob = require("glob");
var BundleTracker = require('webpack-bundle-tracker')
let globOptions = {
ignore: ["node_modules/**", "venv/**"]
};
let entryFiles = glob.sync("**/javascript/*.js", globOptions);
let entryObj = {};
entryFiles.forEach(function(file) {
if (file.includes(".")) {
let parts = file.split("/");
let path = parts.pop();
let fileName = path.split(".")[0];
entryObj[fileName] = `./${file}`;
}
});
const config = {
mode: process.env.NODE_ENV,
entry: entryObj,
output: {
path: __dirname + "/core/static/dist/js",
filename: "[name].[fullhash].js"
},
optimization: {
minimize: true
},
plugins: [
new BundleTracker({
path: __dirname,
filename: "./webpack-stats.json"
})
]
};
//console.log(config);
module.exports = config;