Refactor remote script loading code

This commit is contained in:
Jerome Wu
2020-11-24 11:26:53 +08:00
parent 7a3b66faa3
commit 36a148bb43
3 changed files with 73 additions and 17 deletions

View File

@@ -3,5 +3,5 @@ const { log } = require('../utils/log');
module.exports = ({ corePath }) => new Promise((resolve) => {
log('info', `fetch ffmpeg.wasm-core script from ${corePath}`);
// eslint-disable-next-line import/no-dynamic-require
resolve(require(corePath));
resolve({ createFFmpegCore: require(corePath) });
});