-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
package-postinstall.js
41 lines (37 loc) · 1.21 KB
/
package-postinstall.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
(function OLSKPostinstallHotfix() {
Object.entries(require('OLSKHotfix').OLSKHotfixPatches(process.env.NODE_ENV)).forEach(function ([path, patches]) {
if (!require('fs').existsSync(path)) {
return;
}
Object.entries(patches).forEach(function ([search, replace]) {
require('fs').writeFileSync(path, require('OLSKString').OLSKStringPatch(
require('fs').readFileSync(path, 'utf8'), search, replace));
});
});
})();
(function LCHPostinstallPatchOLSKThrottle() {
let filePath = './node_modules/OLSKThrottle/main.js';
require('fs').writeFileSync(filePath, require('OLSKString').OLSKStringPatch(
require('fs').readFileSync(filePath, 'utf8'),
'delete param1[param2];',
'// delete param1[param2]',
));
})();
(function OLSKPostinstallExternalAssets() {
require('./node_modules/OLSKExpress/modules/OLSKAssets/main.js').OLSKAssetsCopyAssetsFromTo([
'clipboard',
'codemirror',
'file-saver',
'fuzzysort',
'normalize.css',
'OLSKLanguageSwitcher',
'OLSKDecor',
'OLSKRootLink',
'OLSKRouting',
'OLSKServiceWorker',
'OLSKUIAssets',
'ROCORootLink',
'simplecrypto',
'webnative',
], require('path').join(__dirname, 'node_modules'), require('path').join(__dirname, 'os-app/_shared/__external'));
})();