Closed SteveALee closed 8 years ago
Nope, babel won't wrap files into modules — brunch still has that covered, no special setup needed.
You can use one of our official skeletons, https://github.com/brunch/with-react maybe, as a reference.
Additionally, https://github.com/brunch/with-redux features HMR use.
Oh, I think I get it. Brunch wraps each module in a IEFE to isolate them?
Thanks for the links
A bit more than that — by default brunch wraps each file into a CommonJS module. It's configurable (and can be amd
or something custom; but npm integration only works with CommonJS for obvious reasons).
firstly let me say what excellent documentation this is. Almost all questions I had were clearly answered and I could easily figure how to apply to my existing code.
If only webpack docs were as good. I literally spent several days getting a pretty basic build and dev server setup. And my requirements were similar to brunch conventions with several html files and HMR.
So the one unanswered question is that like I suspect many these days I use Es6 modules via babel. It's not clear how I should configue brunch in this case. I quess we turn modules off but as babel transpiles to commonJS I'm not sure.