-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hey folks,
Having spent countless hours crafting webpack configurations, I find the concept of faucet quite appealing and am currently trying to bundle a simple React application. Unfortunately, I can't really wrap my head around how to do it. A reproducing repository of my problem can be found at ngrewe/faucet-pipeline-react.
If I run this through faucet with (I managed to solve this problem, see comment below)jsx and esnext set to true, I end up with a bundle that is unusable in the browser because it still contains commonJS require() calls. These calls are from code imported from within my node_modules folder, so it seems that rollup is not making any effort to pull them into the bundle correctly. Interestingly, if I add a require() call to my own code, that will be bundled properly.
I've also noticed that if I do not include esnext: true in the faucet configuration, all require()d modules are correctly bundled up, but then things trip up on the various places where React uses process.env.NODE_ENV, which remains present in the finished bundle. In the webpack world, that would automatically be defined away according to the --mode switch – how is Rollup/Faucet supposed to handle this? Any pointers would be greatly appreciated.
Thanks,
Niels