Skip to content
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

Webpack code splitting with require.ensure() #76

Open
bfncs opened this issue Feb 9, 2017 · 2 comments
Open

Webpack code splitting with require.ensure() #76

bfncs opened this issue Feb 9, 2017 · 2 comments

Comments

@bfncs
Copy link

bfncs commented Feb 9, 2017

Is it currently possible to build an application that makes use of webpack code splitting with require.ensure() to render routes and be able to do static rendering of these routes as well? If not, what is needed to make this happen and is it planned? Is there a workaround?

I saw #31 but this seems to only make sure require.ensure() can occur in compiled code at all - but using it inside the render method used by the static rendering plugin is not possible?

@felguerez
Copy link

We're trying to implement server-side rendering on top of code splitting inside React Router but running into the same issue.

I noticed the React Router example was removed recently -- is code splitting still supported by this library to achieve statically rendered markup?

@wochap
Copy link

wochap commented May 22, 2017

It's possible; I'm using code splitting with react-router, i run two times webpack, the first for build the client, and the second for build all static pages. how it works? by using LimitChunkCountPlugin, webpack with node as target and libraryTarget set to commonjs-module.

Project with code splitting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants