Question: use hypeform with rollup
boye opened this issue · comments
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., optionignore
in.babelrc
.) Quick check: Try importingdist/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 likeimport { hyperform } from '...'
? -
Hiccup of
npm
: Istail -n 1 node_modules/hyperform/src/hyperform.js
showing the above export line?
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 😃