-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
61 lines (58 loc) · 1.8 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const DisableOutputWebpackPlugin = require("disable-output-webpack-plugin");
const JazzUpdateSitePlugin = require("jazz-update-site-webpack-plugin");
const RemovePlugin = require("remove-files-webpack-plugin");
const core = require("@actions/core");
const moment = require("moment");
const packageJson = require("./package.json");
module.exports = env => {
const timestamp = moment().format("[_]YYYYMMDD[-]HHmm");
const version =
(typeof env !== "undefined" && packageJson.version + "_" + env.buildUUID) ||
packageJson.version + timestamp;
const projectId = "com.siemens.bt.jazz.workitemeditor.rtcHideToolbarActions";
const config = {
entry: {
app: "./index.js"
},
plugins: [
new DisableOutputWebpackPlugin(),
new JazzUpdateSitePlugin({
appType: "ccm",
projectId: projectId,
acceptGlobPattern: ["resources/**", "META-INF/**", "plugin.xml"],
projectInfo: {
author: packageJson.author,
copyright: packageJson.author,
description: packageJson.description,
license: packageJson.license,
version: version
}
}),
new RemovePlugin({
before: {
root: __dirname,
test: [
{
folder: "./",
method: filePath => {
return new RegExp(
/com\.siemens\.bt\.jazz\.workitemeditor\.rtcHideToolbarActions.*\.zip$/,
"i"
).test(filePath);
}
}
]
},
after: {
root: __dirname,
include: ["dist"]
}
})
]
};
if (process.env["GITHUB_ACTIONS"]) {
// Set the output file name for use in GitHub Actions
core.setOutput("output_file", `${projectId}_${version}.zip`);
}
return config;
};