Jennifer Fu
1 min readJun 9, 2020

--

Hi @olavo.a.santos, thanks for sharing your experience with us. Yes, it is a good approach to pass down dependencies though the shell. We do it to certain degrees, but not as much. But this definitely is a way of sharing.

Cam Jackson’s original article also gives a solution for this:

  1. Mark the libraries as externals in webpack configuration:
module.exports = (config, env) => {
config.externals = {
<packages>
}
return config;
};

2. Then add a couple of script tags to each index.html file, to fetch these libraries from shared content server:

<script src="%REACT_APP_CONTENT_HOST%/<packages>"></script>

We did not go this route since the bundle size is not an issue at this point.

We don't have SSR requirements yet, but it is definitely an interesting challenge.

--

--