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.

Looking for secondary entry points is VERY slow

See original GitHub issue

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

On Windows, the call “const findSecondaryPackagesPaths = (directoryPath, excludeFolder) =>” takes a very long time (about 1 minute). This slows down the build process tremendously.

I assume that this is because the file search does not exclude node_modules as a whole but only the package.json files inside the folder. This causes the scan to iterate over the complete directory, which is very slow.

How To Reproduce

Use ng-packager on Windows with a project that has a relatively large dependency tree.

Expected Behaviour

I would expect the scan for the secondary entry point to be either faster or see a way to disable it.

Version Information

ng-packagr:            3.0.2
@angular/compiler:     6.0.1
rollup:                0.59.4
tsickle:               0.27.5
typescript:            2.7.2

Please include all version numbers that might be relevant, e.g. third-party libraries

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
CarstenLeuecommented, Jun 14, 2018

This pattern works for me:

'**/node_modules/**'

I have actually done a simple testcase to validate what files glob iterates over:

const Promise = require('bluebird');
const globFiles = Promise.promisify(require('glob'));

const directoryPath = __dirname;

const ignore = ['**/node_modules/**'];

const cache = {};

const res = globFiles(`${directoryPath}/**/package.json`, {
  ignore,
  cwd: directoryPath,
  cache
});

res.then(console.log).then(() => console.log('cache', cache));

The content of “cache” shows the touched files.

With the original pattern, the cache is filled with all files in node_modules. With the updated pattern this is not the case.

0reactions
github-actions[bot]commented, Jun 19, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular/material entry-point causes very slow builds with Ivy
ngcc compiles all entrypoints within the @angular/material package as well as some/all entry-points within @angular/cdk package. This delays the ...
Read more >
Improve SPA performance by splitting your Angular libraries in ...
A library that doesn't perform can slow down multiple applications! ... Secondary entry points are dynamically discovered by ng-packagr ...
Read more >
Performance and synchronization problems when you work ...
Describes an issue where you experience performance and synchronization problems when you try to access folders in a secondary mailbox in Microsoft Outlook....
Read more >
how to sweeten ng-packagr secondary entry point path when ...
Shared Component Setup. I have a shared angular component, with as a secondary entry point a bunch of protractor utilities to make it...
Read more >
Classroom Accommodations for Slow Processing Speed
Show what a completed project looks like before the student begins. Establish clear starting points for tasks rather than just giving a due...
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