forked from energywebfoundation/switchboard-dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpatch.js
28 lines (25 loc) · 727 Bytes
/
patch.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
/**
* This file is for patching import for nats.ws
* With Angular 12 current import inside iam-client-lib is making an error while building application.
* This patch fixes import before building application.
*/
// eslint-disable-next-line
const fs = require('fs');
const file = 'node_modules/nats.ws/package.json';
fs.readFile(file, 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
const result = data.replace(
'"exports": {\n' +
' ".": {\n' +
' "require": "./nats.cjs",\n' +
' "default": "./nats.js"\n' +
' }\n' +
' },',
''
);
fs.writeFile(file, result, 'utf8', function (err) {
if (err) return console.log(err);
});
});