-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package-postinstall.js
40 lines (37 loc) · 1.22 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
(function OLSKPostinstallHotfix() {
Object.entries(require('OLSKHotfix').OLSKHotfixPatches(process.env.NODE_ENV, {
OLSKHotfixPatchesNotReversible: Object.assign(Object.fromEntries(require('glob').globSync('./node_modules/OLSKUIAssets/_OLSKSharedFeature*', {
cwd: __dirname,
realpath: true,
}).map(function (e) {
return [e, {
'rgb(0, 0, 0)': 'rgb(255, 128, 0)',
}]
})), {
'./node_modules/vcards-js/index.js': {
"require('fs')": "_require_('fs')",
"require('path')": "_require_('path')",
},
})
})).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 OLSKPostinstallExternalAssets() {
require('./node_modules/OLSKExpress/modules/OLSKAssets/main.js').OLSKAssetsCopyAssetsFromTo([
'normalize.css',
'OLSKDecor',
'OLSKRouting',
'OLSKUIAssets',
'launchlet',
'ROCORootLink',
'webnative',
'html5-qrcode',
], require('path').join(__dirname, 'node_modules'), require('path').join(__dirname, 'os-app/_shared/__external'));
})();