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

How do we handle Multiple Entry points. #31

Closed
mihirsoni opened this issue Sep 21, 2016 · 3 comments
Closed

How do we handle Multiple Entry points. #31

mihirsoni opened this issue Sep 21, 2016 · 3 comments

Comments

@mihirsoni
Copy link

Hi @halt-hammerzeit

I know this might not be an issue , just putting as discussion thread.

Say I have multiple entry points in my webpack.config.js. e.g Home.js , About.js

Now on server side we have only one HTML file , how do we stop loading About.js while visiting Home ?

@catamphetamine
Copy link
Owner

It makes sense to have a single bundle (with only one entry point) on the server side because code splitting is pointless on the server (no latency)

@mihirsoni
Copy link
Author

In that case , we will have always app.js inside a <script> tag that is what you are trying to say,

in a case https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/helpers/Html.js#L53 Can't we just load page specific JS here ?

@catamphetamine
Copy link
Owner

No, I'm speaking about the server-side bundle.
The server-side bundle must not be placed inside <script/> tag.

The client-side bundle is.
And it retains all its entry points.
You can console.log it to make sure it does.

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

2 participants