Create-react-app: How to disable chunks splitting without ejecting CRA2?

Created on 2 Apr 2019  路  4Comments  路  Source: facebook/create-react-app

Hi,

I just migrate a single page up raised up with CRA1 with external Typescript support to CRA2.
Till here, everything's fine.
Our infrastructure is composed by micro-frontend services and has the limitation that the main App expect to handle a unique bundle file for each service and changing that may costs us a lot of effort.
Clearly, having chunks splitting as an option is not what CRA2 proposes.
I surf a lot on the topic and seems the only solution to avoid chunking pieces is to eject the project and configure Webpack manually.
To me sounds too extreme and maybe exists a cleaner way to comes out of this situation without losing the clear advantage to stay with CRA2.x as far as we can.

So, thanks.
Waiting for your opinions.

All 4 comments

Related/Duplicate: #5306

Thanks @miraage! Closing as duplicate.

@soulclown There isn't a solution to this out of the box right now, but that thread has a few options. It looks like there's a lot of demand for this feature, but no guarantee it'll ever land.

@soulclown You can customise the webpack config slightly without ejecting by using react-app-rewired. I've published a rewiring package that will do this for you: https://www.npmjs.com/package/react-app-rewire-disable-chunks. I also needed to do this for micro frontend purposes.

Hi @camjackson so nice from you.
Here we finally decided to keep multiple chunks and improve the infrastructure behind instead. (just because it was possible).
For sure someone else will have the same requirement we had, maybe this discussion will help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

jnachtigall picture jnachtigall  路  3Comments

dualcnhq picture dualcnhq  路  3Comments

adrice727 picture adrice727  路  3Comments