-
Notifications
You must be signed in to change notification settings - Fork 488
/
webpack.config.license.js
59 lines (52 loc) · 1.7 KB
/
webpack.config.license.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
/**
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership.
*
* Camunda licenses this file to you under the MIT; you may not use this file
* except in compliance with the MIT License.
*/
const path = require('path');
const { IgnorePlugin } = require('webpack');
const { LicenseWebpackPlugin } = require('license-webpack-plugin');
const overrides = require('./tasks/license-book-handlers/license-book-overrides');
/** @type {import('webpack').Configuration} */
const config = {
mode: 'development',
devtool: false,
target: 'electron-main',
entry: './app/prod.js',
output: {
path: path.resolve(__dirname, 'tmp'),
},
resolve: {
mainFields: [ 'main' ],
},
plugins: [
new IgnorePlugin({
checkResource(resource) {
// WONTFIX(barmac): ignore C++ modules for now
// they are added to the license book through optional-dependencies.js
if (/^vscode-windows-ca-certs/.test(resource)) {
return true;
}
return false;
}
}),
new LicenseWebpackPlugin({
...overrides,
outputFilename: 'dependencies.json',
perChunkOutput: false,
excludedPackageTest: (packageName) => {
// TODO(@philippfromme): workaround for https://github.com/camunda/camunda-modeler/issues/3249
// cf. https://github.com/xz64/license-webpack-plugin/issues/124
return packageName === 'camunda-modeler';
},
renderLicenses: (modules) => {
return JSON.stringify(modules, null, 2);
}
})
]
};
module.exports = config;