cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zak (JIRA)" <>
Subject [jira] [Created] (CB-13992) Remove dependency-ls or provide option to skip npm checks
Date Tue, 20 Mar 2018 03:06:00 GMT
Zak created CB-13992:

             Summary: Remove dependency-ls or provide option to skip npm checks
                 Key: CB-13992
             Project: Apache Cordova
          Issue Type: Wish
          Components: cordova-cli, cordova-fetch
    Affects Versions: 8.0.0
            Reporter: Zak

I noticed that our CI builds of cordova projects are very slow when adding the platforms -
the stage where plugins are added taks a few minutes for each build. I did some digging around
and profiling and eventually found that the slowest part is where `cordova-fetch` uses the
`dependency-ls` module to list all installed dependencies of the project before and after
installing each plugin.

This dependency runs `npm list --depth=0` under the hood which is slow (~5 seconds per run
on a relatively small Ionic project). You can test this by running this small script:

{{var depls = require('dependency-ls')}}
{{return depls(process.cwd())}}
{{.then(function(result) {}}
{{  console.log(result)}}

Note also that the dependency runs twice for each plugin in the project adding 10 seconds
per plugin. This means it can take a few minutes just to add a platform to the project - although
this is much slower in CI/Docker build environments.

However, this step seems pretty redundant since the plugins are likely already installed via
npm since they are now saved in the package.json file. I made a fork of cordova-fetch which
removes this step completely and just uses the existing plugins in `node_modules` and the
time to add platform drops down to ~7 seconds (down from minutes) with no change to the actual
result since the plugins are already there.

Since plugins now install via npm and save to package.json by default it would be nice to at
least provide the option to skip this npm step for plugins for cases where they already exist
in node modules, if it can't be removed completely.



This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message