Lazy imports fail to be compiled
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 9.8k
- Forks
- 326
- PR merge metrics
- No merged PRs in 30d
Description
I was compiling a CLI with update-notifier.
However, they're lazy importing - which results in packages being missed when compiling.
Their code looks like this:
const importLazy = require('import-lazy')(require);
const isCi = importLazy('is-ci');
The compiled code expects is-ci to be a dependency.
Here's a related issue someone raised with them: https://github.com/yeoman/update-notifier/issues/123.
PS: This is a great package.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by compiling a CLI that uses update-notifier and its import-lazy pattern, then inspect ncc's handling of dynamic requires. Done means the compiled output recognizes and includes the lazily imported is-ci dependency and the resulting CLI runs correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100