CreateJS/PreloadJS

Cannot find module 'preloadjs.js'

brunoimbrizi opened this issue ยท 4 comments

In package.json, shouldn't "main": "preloadjs.js", be pointing to "main": "lib/preloadjs.js",?

As is, trying to import 'preloadjs'; results in an error Cannot find module 'preloadjs.js'.
Modifying the "main" attribute manually makes it work fine.

You might be right. The CreateJS libraries don't currently have any exports, so you can't use them with Require/Common module loaders (yet, next version!!). I will look at addressing that issue in the mean time. Thanks!

3dos commented

Manually modifying the package.json like mentioned didn't do the trick for me. I can't wait to see the next version with module exports coming ! In the meantime, I'm using this little package : https://www.npmjs.com/package/preload-js

Closing for now. We will ensure that the next version has full import support.

combs commented

I'm still seeing "main": "preloadjs.js" in the package.json for npm preloadjs 1.0.1 FWIW