joeldenning / simple-single-spa-webpack-example

A simple example of how to use webpack with single-spa
MIT License
294 stars 95 forks source link

Why not dependencies in externals of webpack #36

Closed Flamingo09 closed 4 years ago

Flamingo09 commented 4 years ago

By going through webpack config, I understand that you are optimizing dependencies by applying split chunks on it. If you don't mention those dependencies in external, won't they be re-fetched for each micro-app and also, why adding them in entry point.

Just trying to understand the purpose of the code, the way it is written.

joeldenning commented 4 years ago

Hi @Flamingo09, good question.

When everything is in a single repo with a single webpack config, webpack can do all the optimizations to avoid duplicate dependencies without marking things as externals.

Flamingo09 commented 4 years ago

Thanks 👍