-
Notifications
You must be signed in to change notification settings - Fork 12k
Once I have created a lazy loaded css file, how do I lazy load it? #11235
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
Having the same issue, an example will be helpful! |
filipesilva
added a commit
to filipesilva/angular-cli
that referenced
this issue
Jul 7, 2018
Heya I was looking into this today and think I have a solution in #11491. |
filipesilva
added a commit
to filipesilva/angular-cli
that referenced
this issue
Jul 7, 2018
filipesilva
added a commit
to filipesilva/angular-cli
that referenced
this issue
Jul 10, 2018
clydin
pushed a commit
that referenced
this issue
Jul 10, 2018
clydin
pushed a commit
that referenced
this issue
Jul 12, 2018
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Among the many awesome things in the Angular CLI is the ability to lazy load a CSS file. My problem is that the documentation doesn't specify how to load it once you create it. When you run the build, the file that gets created for your css has a hash in the name, like
foo.asdf908a7sd0as7g.bundle.css
. Because the name of the production file isn't a static name, I can't figure out how to lazy load it. If there is a known way to do this, please show me, and I will help out and PR the docs.Bug Report or Feature Request (mark with an
x
)Area
Versions
Angular CLI: 1.7.4
Node: 9.5.0
OS: darwin x64
Angular: 5.2.11
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cdk: 5.2.5
@angular/cli: 1.7.4
@angular/material: 2.0.0-beta.12
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.4.9
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.6.2
webpack: 3.11.0
Repro steps
foo.css
.The log given by the failure
There is no log, cause there is no failure.
Desired functionality
I would love to see a way to lazily load these css files.
Mention any other details that might be useful
#5880 was a similar question that never got answered and was closed. A few people suggested some work arounds that don't work for production mode when the css file gets the hash included in it's name. The suggestions only work in dev mode.
In a separate issue @filipesilva acknowledges that while a way to create lazily loaded css files exists, there is no provided way to load these created files. We need to get a way to allow people to load these created css files. In that issue, the participants are using native webpack functionality to load these css files. I don't want to use Webpack directly, because that will make it harder for me to upgrade my CLI one day when it switches to Bazel.
The text was updated successfully, but these errors were encountered: