-
Notifications
You must be signed in to change notification settings - Fork 12k
Files not declared in angular.cli/assets and referenced in templates are not being fingerprinted and copied to root (dist) after compilation #8139
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
A component's template is not static HTML and as a result cannot, in the general case, be safely analyzed as such. To properly handle statically analyzing for assets, a system would need to be put into place that could provide such capability as, but most likely not limited to, read only attribute marking, asset attribute marking, and dynamic asset context discovery. |
Consider the image.png file inside a module from the app and a template html file in the same directory and that contains the tag |
The templates are not static which means that what is contained within the source file and what is actually rendered in the web browser can be radically different. And the web browser is what is fetching and loading the asset. To properly perform static analysis on the template, the entire context of that template needs to be taken into account. This would not only include the component code but also the application's module hierarchy (e.g., an Angular directive from a 3rd-party module could be altering or adding |
I have to close this issue as a duplicate of #3415 to keep the discussion in a single place, but I'll mention there that there's really good discussion in here of the challenges for adding this feature. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
@angular/cli: 1.4.4
node: 6.11.1
os: darwin x64
@angular/animations: 4.2.6
@angular/cdk: 2.0.0-beta.8
@angular/common: 4.2.6
@angular/compiler: 4.2.6
@angular/compiler-cli: 4.2.6
@angular/core: 4.2.6
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 4.2.6
@angular/http: 4.2.6
@angular/material: 2.0.0-beta.8
@angular/platform-browser: 4.2.6
@angular/platform-browser-dynamic: 4.2.6
@angular/platform-server: 4.2.6
@angular/router: 4.2.6
@angular/cli: 1.4.4
typescript: 2.3.4
macOS X Yosemite
Repro steps.
ng serve
orng build
The log given by the failure.
Desired functionality.
Images and other files inside a module or component, if referenced in
srcs
of tag elements inside templates, should be copied to root (dist) and fingerprinted as in CSS files.The text was updated successfully, but these errors were encountered: