daKmoR / rocket

Move to https://github.com/modernweb-dev/rocket/
MIT License
13 stars 5 forks source link

CommonJS dependencies? #108

Open guillemcordoba opened 3 years ago

guillemcordoba commented 3 years ago

Hi guys! Great effort this project, as always.

I know it's early still, but is there some way to enable support for commonjs dependencies?

daKmoR commented 3 years ago

thx 🤗

what do you mean with "support for commonjs dependencies"?

guillemcordoba commented 3 years ago

Oh, so when trying to launch/build with a markdown file that contains a js story that imports a commonjs dependency, I get this error:

Uncaught SyntaxError: The requested module './../../../cytoscape-dagre/cytoscape-dagre.js' does not provide an export named 'default'

I figured this was because you are using rollup building without explicit commonjs plugin, no? Would it be useful if I tinker with a minimal commonjs setup and make a PR?

daKmoR commented 3 years ago

hmmm I'm not sure if we want to add this "complexity" by default 🤔

but we should certainly document how you can add @rollup/plugin-commonjs to serve and build...

hmmm thinking about it I'm not sure if I already added such an option 🙈