wxt-dev / wxt-dev/wxt

Provide util for generating import paths from file paths

Open
#2,146 6 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.