-
Notifications
You must be signed in to change notification settings - Fork 433
Lazy Loading with Webpack? #191
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
Comments
You should be able to just do Is that not working? |
It wasn't working consistently. I'm not sure where the problem would be originating from. Does it only work if I define the routes in the main app module? The Angular website recommends having a routes specific module. |
Added lazy loading demo into application, take a look at PR #197 to see what you were missing! |
Man, you sure are fast.... Thanks
Interesting, doesn't look like you were doing anything different.
I bet the issue was I had switched to a App Routing module (which is
recommended off the angular website)... I wonder if either Angular or
Webpack weren't properly identifying paths.
I was setting the routing up from app/modules/routing/routing.module...
but like i said, sometimes it would work, sometimes it wouldn't.... just
weird
I'll just try falling back and putting my routes in the root module and see
if it makes my life easier again
…On Wed, Apr 19, 2017 at 10:17 AM, Mark Pieszak ***@***.***> wrote:
Added lazy loading demo into application, take a look at PR #197
<#197>
to see what you were missing!
Hope that helps 👍
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#191 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIeSJJbxbxyCPI3uFpcOqx5yFNa7U-suks5rxiWggaJpZM4M_yqh>
.
|
Yeah I just kept everything in the app.module mainly to keep things easier for people, so they don't have to import things twice, once in the declarations, and once again in a different routing file. Glad it's working at least now, I can't imagine why having a routing module would affect anything, bizarre! |
Yes that is so strange |
Is there a way to setup lazy loading with webpack?
When I use lazy loading in my routes, it seems inconsistent, sometimes it works, sometimes it tells me it can't find the module. But more than that, obviously we are packing the whole project into a single JS file which is the opposite of lazy loading.
Is there an easy way to add a module that lazy loads to the example that has its JS loaded on the fly vs in the main client js file?
The text was updated successfully, but these errors were encountered: