You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importColorfrom'colorjs.io'constred=newColor('red')constblue=newColor('blue')// ERROR: .contrast is not a functionred.contrast(blue,'WCAG21')// ERROR: .deltaE is not a functionred.deltaE(blue,'2000')// PASSED// red.contrastWCAG21(blue)// red.deltaE2000(blue)
@ambar Thanks for reporting -- I can reproduce this error using esbuild@0.15.12 (though I can't reproduce it using vite@3.2.2). During minification, esbuild by default renames function names, and colorjs.io relies upon function names in its default package export. You can disable the esbuild feature by adding --keep-names to your command:
Bug
Using vite@3.2.2 or esbuild@0.15.12
Reproduce
input.js
bundle:
esbuild --bundle --minify input.js --outfile=bundle.js && node bundle.js
The text was updated successfully, but these errors were encountered: