-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
53 lines (51 loc) · 1.9 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
const DisableOutputWebpackPlugin = require('disable-output-webpack-plugin');
const JazzUpdateSitePlugin = require('jazz-update-site-webpack-plugin');
const RemovePlugin = require('remove-files-webpack-plugin');
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 config = {
entry: {
app: './index.js'
},
plugins: [
new DisableOutputWebpackPlugin(),
new JazzUpdateSitePlugin({
appType: 'ccm',
projectId: 'com.siemens.bt.jazz.workitemeditor.rtcEmailWorkItemAction',
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\.rtcEmailWorkItemAction.*\.zip$/, 'i').test(filePath);
}
}
]
},
after: {
root: __dirname,
include: ['dist']
}
})
]
};
return config;
};