-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Setting up code splitting in Webpack and React Router #2433
Comments
If you are comfortable with using Webpack 2 Beta you can try
Also take a look at this Tutorial, which pushed me into the right direction when setting up code splitting. Keep in mind that this will only work on the client side out of the box. For the time being i use another route file with the exact same routes using static imports on the server. |
Thanks for the hint. Yes I did see the tutorial before, but I don't think I would want to use Webpack 2 in production until it hits at least 2.0.1. I was hoping that someone would point out some config that I missed that makes the whole thing not work. Here are some of my suspects:
|
I have the same problem; |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
I've gone through all parts of the documentation and went through a whole bunch of tutorials all over the web, but I'm still missing something.
I'm trying to set up chunking in my app by route, using
require.ensure
. So here's my route:Here are relevant lines from my webpack config:
When I navigate to the page in the route, I see in the logs that the required chunk does get downloaded. The page however does not load.
And I see the following stack trace in the browser console:
The line it complains about is this:
The second line
((anonymous function) @ main.js:44637)
is essentially this:Note, if I do
console.log(require('./attendee/containers/Profile/').default)
, I get a function as an output, so I'm not sure why it is undefined. And of course when I do that the code works, but than there's no chunking any more.So I'm doing something wrong with the
require
. Any idea what it is? ThanksI asked the same question on SO with no results: http://stackoverflow.com/questions/36988975/setting-up-code-splitting-in-webpack-and-react-js
The text was updated successfully, but these errors were encountered: