web-infra-dev / web-infra-dev/rslib

[Feature]: Warning for potential runtime error when shims is not enabled

Open
#295 0 comments 0 reactions 1 assignee View on GitHub

@fi3ework is already working on this.

Since Oct 15, 2024.

💡 feature
Dominant language
TypeScript
Stars
1k
Forks
67
Avg merge
6h 9m
Merged PRs (30d)
57

Description

What problem does this feature solve?

For example, if the shim of __dirname is not enabled for ESM output, there will be a runtime error when executing. It's better to provide a warning when building.

What does the proposed API look like?

Possible solutions:

  1. By parser hooks (Rspack not supported yet).
  2. Dedicated Lexer.

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.