1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 18:35:09 +01:00
onion/js/third_party/imports/audiojs.js
Brett Sun 2921c2adac Handle dependencies that should be split from the main app
Using ES6’s System.import allows webpack to split up the dependency
into its own chunk and load it as necessary. When this is not possible
(ie. when a script expects itself to be dropped into the html), follow
the previous strategy of copying the dependency folder into the build
folder.
2016-06-02 17:14:58 +02:00

19 lines
518 B
JavaScript

import AppConstants from '../../constants/application_constants';
import { InjectInHeadUtils } from '../../utils/inject_utils';
/**
* Imports audiojs from the copied directory.
*
* Unfortunately, audiojs' package structure and the way it currently loads image assets prevents us
* from using System.import.
*
* @return {Promise} Promise that resolves with [audio.min.js] on success.
*/
function importLib() {
return InjectInHeadUtils.inject(AppConstants.audiojs.sdkUrl);
}
export default { importLib };