Combining Bazel for dev and Webpack for prod
Guys, I tried Bazel several months ago and I was shocked how Bazel is improving the development flow. I can't wait anymore to use it in every Angular projects. I didn't get into all the details but I'm wondering if we can easily combined both approaches meaning Bazel for dev and using Webpack to package the app in prod since the feature still in experimental mode.
Please enlighten me on that.
Thanks
@alexeagle could you please help with that? thanks in advance!
As soon as https://github.com/bazelbuild/rules_nodejs/pull/577 lands, you just replace rollup_bundle with webpack_bundle in this example. That's just the first step though. Then we have to have parity with your current use cases. I fear that many ppl don't even know all the things they rely on webpack to do. We might need an incremental migration story where you bring your existing webpack config and we modify it.
okay see https://github.com/bazelbuild/rules_nodejs/tree/master/e2e/webpack for an example of using the webpack rule - add a devDependency on @bazel/labs and then you should be able to load the webpack_bundle rule
@alexeagle thank you so much. I will give a look for sure!
@alexeagle Is it possible to add the webpack_bundle to this example? The Bazel build is 200MB big without any index.html. Would be great when we have a working build in order to deploy it on webserver like Nginx.
webpack_bundle rule is in rules_nodejs - I'm not sure it matters for the angular example which bundler we use though.
Making the bundle smaller is a separate issue. It should be small under rollup too.
I'm moving the example to bazelbuild/rules_nodejs so closing this one.