Problem
adapt-authoring-adaptframework eagerly imports adapt-cli at the top of four source files:
lib/AdaptFrameworkBuild.js
lib/AdaptFrameworkModule.js
Because adapt-cli transitively pulls in bower (~1.7s), inquirer (~2.6s), and download (~1.4s), this adds ~6.6 seconds to every server startup — even though these dependencies are only needed during build/install operations.
Profiling data
| Dependency |
Load time |
| inquirer |
2621ms |
| bower |
1686ms |
| download |
1374ms |
Proposed fix
Convert the top-level import AdaptCli from 'adapt-cli' statements to dynamic await import('adapt-cli') at the call sites. This defers the heavy dependency tree until a build or CLI command is actually executed.
Measured improvement: 6602ms → 25ms import time.
Problem
adapt-authoring-adaptframeworkeagerly importsadapt-cliat the top of four source files:lib/AdaptFrameworkBuild.jslib/AdaptFrameworkModule.jsBecause
adapt-clitransitively pulls inbower(~1.7s),inquirer(~2.6s), anddownload(~1.4s), this adds ~6.6 seconds to every server startup — even though these dependencies are only needed during build/install operations.Profiling data
Proposed fix
Convert the top-level
import AdaptCli from 'adapt-cli'statements to dynamicawait import('adapt-cli')at the call sites. This defers the heavy dependency tree until a build or CLI command is actually executed.Measured improvement: 6602ms → 25ms import time.