Closed vlad-zhukov closed 7 years ago
Did me setting up tree shaking (setting modules: false) break the cjs build? Yes, tests would be good! Sorry :( Is a fix required for the ES build also?
Setting modules: false
disables module transformation, so they will stay as in source files. ES build is fine.
@Vlad-Zhukov Okay. Yeah, could we get testing and also do a PR into the dev branch instead of master? I just recently created that dev branch to try to add a little safety until we get CI setup.
I tested this and saw that it works. I'm going to go ahead and merge the request now, so that I can publish a new build, but can you add tests in a new PR when you get a chance? @Vlad-Zhukov
@Vlad-Zhukov I've published updates. Please, see some changes I made. I had to change BABEL_ENV=cjs
to BABEL_ENV=umd
in the umd build scripts so that tree shaking would continue to work. ("modules": false
is required for tree shaking to work).
Also, even though I didn't have to, I created 3 separate configs in .babelrc, one each for cjs, es, & umd in order to be explicit about what each needs.
Let me know about testing and your ideas about simplifying the build process.
@joshburgess I had a thought about producing all bundles with a single command but now I think it's better leave it as it is right now. I guess I'll just clean up configs a little for now.
I added simple tests (see Vlad-Zhukov/redux-most#4c36e80) for bundles but they don't work because babel-register transforms other files as well. Not sure how to properly fix this as I have no experience with ava.
Files under
lib/
use ES modules instead of commonjs. This is a simple fix, but I can later simplify the whole build process if you want.Also should I add tests for this?