Skip to content

add support for external template/styles in webpack branch #1371

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

Closed
jeffbcross opened this issue Jul 18, 2016 · 6 comments
Closed

add support for external template/styles in webpack branch #1371

jeffbcross opened this issue Jul 18, 2016 · 6 comments
Labels
effort1: easy (hours) feature Issue that requests a new feature P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@jeffbcross
Copy link
Contributor

I tried removing the isMobile special case from app.component.ts and use the standard templateUrl and styleUrls to see if the new webpack magic would automatically fix the issues with loading external templates, but it still fails. I walked through with @gdi2290 and he proposes that we make the webpack app shell plugin (addon/ng2/utilities/prerender-webpack-plugin.ts) run against webpack-already-processed files/bundles, which will have already inlined the template and styles via the angular2-template-loader.

Patrick says he can have it done in 5 minutes from now.

@PatrickJS
Copy link
Contributor

I got it working in 5 minutes but ran into a problem with importing in different contexts (known problem when working in Node with Angular 2 because Angular's di relies on references. The other problem is Reflect which has the same problem). I just need to isolate the prerendering in a separate process

@filipesilva
Copy link
Contributor

I like that idea, it will make mobile much less special-case-y.

I should mention that at the moment we're using a built-in version of angular/universal#464 instead of importing prerender-webpack-plugin.ts, but that we should import it once the PR is in.

@PatrickJS
Copy link
Contributor

it shouldn't be too hard to also prerender other pages with folders using the router config. I got it working if routes was exported

@filipesilva filipesilva added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful and removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Jul 28, 2016
@filipesilva
Copy link
Contributor

@gdi2290 did you manage to get it working? If you point me in the right direction I can maybe pick it up.

@filipesilva filipesilva added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful labels Aug 26, 2016
@hansl
Copy link
Contributor

hansl commented Jan 11, 2017

Closing this as fixed already.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort1: easy (hours) feature Issue that requests a new feature P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

4 participants