forked from ag-grid/ag-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
customise.js
37 lines (34 loc) · 1.97 KB
/
customise.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
/**
* There are some issues which we have had to resolve by editing plugins as it was the only way to achieve what we
* needed to. This script applies these customisations by replacing content inside the node_modules after they've been
* installed; perhaps we should fork the plugins properly and point to those instead.
*/
// const fs = require('fs-extra');
//
// // fs.copySync('./scripts/customise/index.js', './node_modules/@rollup/plugin-node-resolve/dist/cjs/index.js')
//
// console.log(`--------------------------------------------------------------------------------`);
// const fs = require('fs');
//
// const packageRootDirectories = JSON.parse(fs.readFileSync('lerna.json', 'utf-8')).packages;
// for (const lernaPackage of packageRootDirectories) {
// const packageRootDirectory = lernaPackage.replace('/*', '');
// fs.readdirSync(packageRootDirectory)
// .forEach(packageDirectory => {
// const packageJsonFilename = `./${packageRootDirectory}/${packageDirectory}/package.json`;
// if (fs.existsSync(packageJsonFilename)) {
// const packageJson = JSON.parse(fs.readFileSync(packageJsonFilename, 'utf-8'));
//
// if(packageJson.dependencies && packageJson.dependencies['ag-charts-community'] ||
// packageJson.devDependencies && packageJson.devDependencies['ag-charts-community'] ||
// packageJson.peerDependencies && packageJson.peerDependencies['ag-charts-community']
// ) {
// const chartsPkgFilename = `./${packageRootDirectory}/${packageDirectory}/node_modules/ag-charts-community/package.json`;
// const chartsPkg = require(chartsPkgFilename);
// delete chartsPkg['exports'];
// fs.writeFileSync(chartsPkgFilename, JSON.stringify(chartsPkg, null, 2), 'utf-8');
// }
// }
// }
// )
// }