question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Big impact on compilation time and the chunk size with the pro packages

See original GitHub issue

Importing only one icon from the pro packages, results in a 1MB plus in the bundles and 10 minutes additional compiling time.

Here is a minimal code to reproduce the issue :

`import { NgModule } from ‘@angular/core’; import { FontAwesomeModule } from ‘@fortawesome/angular-fontawesome’; import { library } from ‘@fortawesome/fontawesome-svg-core’;

import { faCircleNotch } from ‘@fortawesome/pro-regular-svg-icons’; library.add(faCircleNotch);

@NgModule({ imports: [FontAwesomeModule] }) export class IconModule {} `

Import this module in the app.module.ts.

I have the same behavior with smaller impact with the free packages, probably because it has less icons.

Here is a reproduction repo : https://github.com/ibenjelloun/angular-fortawesome-issue34-reprodution

after the clone just update the .yarnrc with the fontawesome registry or replace pro by free in the icon.module.ts. run yarn + yarn bundle-report

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:30 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
robbamancommented, May 14, 2018

I’ve updated my project using the steps specified in the UPGRADING.md file and while it does seem to work, the production build time for angular using ng build --prod has has gone up immensely. I haven’t timed it, but I think it hangs at the step 92% chunk asset optimization UglifyJSPlugin for at least a few minutes. After which the vendor chunk is up to 7.5MB.

Using deep links ea:

import { faCalendar } from "@fortawesome/pro-regular-svg-icons/faCalendar";
import { faArrowRight } from "@fortawesome/pro-regular-svg-icons/faArrowRight";

instead of

import { faCalendar, faArrowRight } from "@fortawesome/pro-solid-svg-icons";

Does seem to fix the package size issue and make the build time acceptable, but obviously this isn’t exactly a pretty solution 😃

2reactions
mlwilkersoncommented, Jul 23, 2018

Looks like Webpack will be released this week with terser instead of uglify-es, which should include the fix for this. In the meantime, another potential work around (for yarn projects) is suggested here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

It takes forever in "92% chunk asset optimization" can ... - GitHub
assets optimization it rarely changes when you only do coding, and specially for my project it takes 2-5 minutes each time. So it's...
Read more >
A comprehensive guide to optimizing your Xcode build - Flexiple
This guide explores all possible ways to reduce Xcode build time. ... Show Build Time; Build System; Architecture impact; Compilation Mode ...
Read more >
What techniques can be used to speed up C++ compilation ...
The default setting for LLVM and Clang is on debug and assertions, and these can impact your compilation time significantly.
Read more >
Are long compiles a thing of the past?
Factors that can lead to long compilation times include: Large code size, obviously. Large projects will have hundreds of thousands of lines ...
Read more >
Unity assembly definition files slower, not faster - Unity Forum
I have 2s compile time in a new project and in my big project it takes ... project requires Assembly Definitions to pack...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found