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
|
'use strict';
const PATCHABLE_FILE = './package.json';
const fs = require('fs');
const data = JSON.parse(fs.readFileSync(PATCHABLE_FILE));
// remove extra dependencies
const removePkg = [
/^electron$/,
/^eslint/,
/^grunt-concurrent$/,
/^grunt-contrib-compress$/,
/^grunt-contrib-deb$/,
/^grunt-contrib-uglify$/,
/^grunt-contrib-watch$/,
/^grunt-electron$/,
/^grunt-eslint$/,
/^puppeteer$/,
/^stats-webpack-plugin$/,
/^sumchecker$/,
/^webpack-dev-server/,
];
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'));
|