Provide util for generating import paths from file paths
Open
@Arktomson is already working on this.
Since Feb 21, 2026.
- Dominant language
- TypeScript
- Stars
- 10.5k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Description
Feature Request
In some cases, simple string interpolation is not good enough when importing an absolute file path, as mentioned in the original issues mentioned below.
We should provide a util from wxt/module for converting file paths to import paths. It should support windows paths and unix paths, as well as escape ' and other characters in paths.
Proposed APIs:
import { formatImportPath } from 'wxt/modules'
Is your feature request related to a bug?
Follow up to #2143 and #1697.
What are the alternatives?
Use a package or existing API?
Additional context
Add any other context or screenshots about the feature request here.
Contributor guide
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.
Assessment
This issue has not been assessed yet.