summarylogtreecommitdiffstats
path: root/package.json.patch.js
blob: b3427c907a7a59b4068ab019014ad3ba0437f02d (plain)
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
'use strict';

const PATCHABLE_FILE = './package.json';

const fs = require('fs');
const data = JSON.parse(fs.readFileSync(PATCHABLE_FILE));

// remove extra dependencies
const removePkg = [
	/^chai$/,
	/^electron-/,
	/^electron$/,
	/^eslint-/,
	/^eslint$/,
	/^grunt-contrib-compress$/,
	/^grunt-contrib-deb$/,
	/^grunt-contrib-watch$/,
	/^grunt-electron$/,
	/^grunt-eslint$/,
	/^mocha$/,
	/^puppeteer$/,
	/^stats-webpack-plugin$/,
	/^sumchecker$/,
	/^webpack-bundle-analyzer$/,
	/^webpack-dev-server$/,
	/keeweb-native-messaging-host$/,
	/keeweb-native-modules$/,
];

Object.keys(data.dependencies).forEach(dep => {
	if (removePkg.some(re => re.test(dep)))
		delete data.dependencies[dep];
});

fs.writeFileSync(PATCHABLE_FILE, JSON.stringify(data, null, '\t'));