-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
33 lines (32 loc) · 952 Bytes
/
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
const ZipPlugin = require("zip-webpack-plugin");
const path = require("path");
const config = {
entry: {
getCustomer: "./Lambdas/getCustomer/index.js",
ticketDetail: "./Lambdas/ticketDetail/index.js"
// createBlog: "./Lambdas/createBlog/index.js",
// getBlog: "./Lambdas/getBlog/index.js",
// updateBlog: "./Lambdas/updateBlog/index.js",
// deleteBlog: "./Lambdas/deleteBlog/index.js"
},
output: {
filename: "[name]/index.js",
path: path.resolve(__dirname, "dist/"),
libraryTarget: "umd"
},
target: "node",
mode: "production",
optimization: { minimize: false }
};
const pluginConfig = {
plugins: Object.keys(config.entry).map(entryName => {
return new ZipPlugin({
path: path.resolve(__dirname, "dist/"),
filename: entryName,
extension: "zip",
include: [entryName]
});
})
};
const webpackConfig = Object.assign(config, pluginConfig);
module.exports = webpackConfig;