img-2
img-2 copied to clipboard
Why do I report an error? Are there examples?

Try
import 'img-2/dist/img-2';
@abraham Your solution works. However, shouldn't the expected behavior be to use either import img-2 as that's the package's name or import Img2 since that's what the documentation shows?
The package name is img-2 as defined by name in package.json. When you install with npm, this is the name you should use to import. I think import 'Img2' was just wrong.
When you do import 'img-2' the loader will typically look for the file defined by main in package.json. Before #10 this was incorrectly pointing at a file that didn't exist.
As a current workaround use import 'img-2/dist/img-2' to explicitly specify the file to load. Once a new version get's published to npm you can switch to import 'img-2'.
Republished as 0.0.4 with the fix provided by @abraham 👍