-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (29 loc) · 916 Bytes
/
index.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
import { Logger } from 'rnv'
import * as fs from 'fs-extra';
const hooks = {
copyTHEOworkers: () => {
Logger.logHook('Copying THEOplayer workers.')
const projectRoot = './';
const targetFolder = `${projectRoot}/appConfigs/base/assets/web/public/theoplayer`;
const workerFiles = [
'theoplayer.d.js',
'THEOplayer.transmux.asmjs.js',
'THEOplayer.transmux.js',
'THEOplayer.transmux.wasm',
'iframe.html'
]
if (!fs.existsSync(targetFolder)){
fs.mkdirSync(targetFolder);
}
workerFiles.forEach((fileName) => {
fs.copyFileSync(
`${projectRoot}/node_modules/theoplayer/${fileName}`,
`${targetFolder}/${fileName}`
);
});
}
};
const pipes = {
'configure:before': hooks.copyTHEOworkers
};
export { pipes, hooks };