hyperform / hyperform

Capture form validation back from the browser

Home Page:https://hyperform.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: use hypeform with rollup

boye opened this issue · comments

commented

I am trying to implement hyperform as ES2015 module with rollup and babel. Though, I am not getting around the 'hyperform' is not exported by node_modules/hyperform/src/hyperform.js error. I have tried the suggestions as stated in the rollup docs.

Has anyone run into this issue as well?

Hm, that's strange. Actually, on Friday I tried rollup myself on the source to see, if it creates smaller bundles than the current JSPM setup (which it doesn't). Worked like a charm here.

Also note the last line of src/hyperform.js:

export default hyperform;

Theoretically, everything should be in place. Let's see.

  • Have you told Babel to exclude files from the node_modules folder? (E.g., option ignore in .babelrc.) Quick check: Try importing dist/hyperform.cjs.js, which uses Node's CommonJS format for modules.

  • Do you import the default? I.e., do you write import hyperform from '...' and not something with curly braces like import { hyperform } from '...'?

  • Hiccup of npm: Is tail -n 1 node_modules/hyperform/src/hyperform.js showing the above export line?

commented

Thank you for your quick reply @Boldewyn! I overlooked the curly braces in import { hyperform } from '...' (shame on me!). Everything is working fine now.

Cheers!

Cool, great to hear that it works! Have fun 😃