just wanted to put this here in case someone else runs into the issue:
I've upgraded to 1.1.0 and everything went fine when running my project but when i ran my tests (using jest+babel) all tests of modules that were importing wcag-contrast broke with error saying that it couldnt find esm module.
Apparently during build, webpack went directly to index.mjs but during test run Jest wasnt.
Configuring Jest to load index.mjs instead didnt help because of the import statements.
esm being a dev-dep of this lib isnt being installed of course.
in the end my quick-win solution was to install esm as a dev-dep of my project.
I'd recommend moving to something like rollup to build your package. this way users of this lib wont have to install anything else.
just wanted to put this here in case someone else runs into the issue:
I've upgraded to 1.1.0 and everything went fine when running my project but when i ran my tests (using jest+babel) all tests of modules that were importing wcag-contrast broke with error saying that it couldnt find esm module.
Apparently during build, webpack went directly to index.mjs but during test run Jest wasnt. Configuring Jest to load index.mjs instead didnt help because of the import statements.
esm being a dev-dep of this lib isnt being installed of course.
in the end my quick-win solution was to install esm as a dev-dep of my project.
I'd recommend moving to something like rollup to build your package. this way users of this lib wont have to install anything else.