require in rollem.config.js doesn't work
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 52
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
When I am trying to import relative module, like it doesn't work. For example, the following rollem.config.js fails
import helper from './my-helper';
export default [/* ...entries... */]
Gives me an error Error: Cannot find module './my-helper.js'
It happens because you are using eval that uses require from the current module context, but not the original rollem.config.js location.
See how that was worked around in Rollup. I think that this trick with temporary replaced require hook should be ported there as well.
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 failure with the rollem.config.js example and its relative ./my-helper import. Read the Rollup runRollup.js workaround linked in the issue, then trace the eval/require handling in Rollem. Done means relative modules imported from rollem.config.js resolve from that configuration file's location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, rollup
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100