Closed rifkegribenes closed 6 years ago
Createjs v1 doesn't officially support using import
or require
. Support is coming in v2. Until then you'll need to import the scripts using good ol' <script />
tags. You can either grab a direct copy from github, or use a cdn. Our official cdn; http://code.createjs.com/ or third parties like https://cdnjs.com/libraries/PreloadJS or https://www.jsdelivr.com/package/npm/preloadjs are all good options.
Another option, since your using WebPack, you can also try imports-loader
Hopefully thank helps!
Hi, I am trying to figure out how to get preloadjs and soundjs to work together in a React project. I had preloadjs working ok on its own when I was importing it from this npm package: https://www.npmjs.com/package/preload-js
But then I found out that the npm package includes an outdated version of preloadjs which is not compatible with the newer version of soundjs which I had downloaded directly from github (https://github.com/CreateJS/SoundJS/blob/master/lib/soundjs.js). And as far as I know there are not npm packages available for the most updated versions of these scripts -- they just have to be downloaded from github and used as-is (let me know if I'm missing something here).
So now I have downloaded the most recent versions of both files from github. (using preloadjs downloaded from here: https://github.com/CreateJS/PreloadJS/blob/master/lib/preloadjs.js) But when I try to import preloadjs like this to create a load queue:
I'm getting the following error:
what am I doing wrong?