Ok. I am only bundling modules from npm as dependencies, and for that rollup plugins worked for me…

The CommonJS plugin? Does that work pretty well? And does it make the module global?

I was concerned it would break with THREE for example due to it’s plugin approach requiring THREE to be global. The wrapper is isomorphic to globals so I felt a bit more confident.

It also works with my still-legacy team. If one of them has a <script> tag with one of my dependencies, I use it rather than my wrapped version. I face a lot of Dual Build issues when most of the team is still legacy.

I’ll give a look tho. Do you Rollup each dependency independently, making a module of each one? Or do you roll them all up together? Or even roll up your entire project, maybe getting some tree-shaking advantages?

Like what you read? Give Owen Densmore a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.