-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
66 lines (62 loc) · 1.72 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
62
63
64
65
66
const webpack = require('webpack');
const JazzUpdateSitePlugin = require('jazz-update-site-webpack-plugin');
const packageJson = require('./package.json');
const core = require('@actions/core');
const DisableOutputWebpackPlugin = require("disable-output-webpack-plugin");
const RemovePlugin = require("remove-files-webpack-plugin");
module.exports = (env) => {
env && env.buildUUID && console.info(`Build UUID is passed along: '${env.buildUUID}'`);
const version = env && env.buildUUID || packageJson.version;
const projectId = "com.siemens.bt.jazz.rtc.workitemeditor.presentation.statushistory";
const config = {
entry: {
StatusHistory: './index.js' // not used, prevent webpack from failing
},
output: {
filename: '[name]Bundle.js' // not used, prevent webpack from failing
},
plugins: [
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\.rtc\.workitemeditor\.presentation\.statushistory.*\.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;
};