-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to properly export autoNumeric as JS module #727
Comments
One of my team members was able to track down the cause by using an older version of the library and slowly moving up, starting from v4.5.4. After comparing between versions, he changes With this knowledge, we have tried to build again autoNumeric source and it worked. output : {
libraryTarget: 'umd',
library : 'AutoNumeric',
filename : 'autoNumeric.min.js',
path : resolve('dist'),
+ globalObject : 'window',
}, We are now using this custom-built version, but I think it might be worth knowing if anyone else happened to stumble on the same error. |
I'd have to check that out thoroughly, since I was always able to export to module on my end. Perhaps indeed I missed something in the few last versions. |
Just to let you know. We're using this with Blazor JSInterop and importing it into the browser. No nodejs, babel, webpack. or anything else. You can see it in action at https://github.com/Megabit/Blazorise/blob/d42a30b34a46870b1cc28bbc36955b6b654732d9/Source/Blazorise/wwwroot/numericPicker.js#L3 Hope it helps. |
Thank you @stsrki. I am getting the same errors as you. Unfortunately AutoNumeric is practically unusable when importing as an ES6 module. Changing |
I'm trying to use autoNumeric as part of my library. And I want to import it as a JS module. But whatever I try I cannot make it work.
The errors I got so far:
If I try to import directly from
src
I getI have tried building autocomplete with
libraryTarget
asumd
,amd
,commonjs2
,commonjs
, etc. Nothing seems to work.I'm missing something. Any chance you could point me in the right direction?
The text was updated successfully, but these errors were encountered: