-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Splitting Support #1056
Comments
It's already supported with |
Please see #1192 if you'd like to help! |
Is this possible now? |
Hi, any news about that? Thanks! |
A 0.10 alpha will be out soon with |
Sorry, but what do you mean with polyfill it in the test environment? Thanks |
Sorry I wasn't more clear. Currently, you can use If you want it to work in Jest ( if (process.env.NODE_ENV === 'test') {
require.ensure = (deps, cb) => cb(require);
} |
Ah ok! If I understand good, I can not test in this moment require.ensure, I
need to change it by sync require, not? Thanks!
…On Thu, 16 Mar 2017 at 23:22, Joe Haddad ***@***.***> wrote:
Sorry I wasn't more clear.
Currently, you can use require.ensure in dev & prod and it will work fine.
If you want it to work in Jest (npm test) you will need to add something
like this:
if (process.env.NODE_ENV === 'test') {
require.ensure = (deps, cb) => cb(require);
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1056 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABWseXQlAN22FY37QPRs1X2RGqiZvhbmks5rmbZBgaJpZM4K1qO9>
.
|
I'm not sure I understand, sorry! |
Do you have any ressources/tutorial to install code splitting on a CRA app with react-router ? |
This is not using React Router but should give you an idea: #1968 (comment). I’m not really sure why you can’t find examples without webpack config changes because code splitting in webpack works out of the box. So it’s not necessary to change anything. |
Thanks @gaearon but even after putting my route this way :
I still see only one js chunk...
|
Please provide a full project reproducing the problem. |
what about it's more convenient rather than require.ensure for my taste "react-scripts": "^0.9.5"
|
@a-x- using Please note CSS isn't minified in that alpha. |
if anyone has an update on the timing of the official switch to System.import() please let me know :) :) |
I'm trying to use I'm trying to go according the docs about this. |
Is it viable to support Code Splitting with CRA?
The text was updated successfully, but these errors were encountered: