wxt-dev/wxt

Config to specify IIFE name or disable it altogether

クローズ

#2,004 opened on 2025/12/16

 (4 件のコメント) (0 件のリアクション) (1 人の担当者)TypeScript (511 件のフォーク)user submission
contribution welcomegood first issue

Repository metrics

Stars
 (9,861 個のスター)
PR merge metrics
 (平均マージ 11d 22h) (30d で 51 merged PRs)

説明

Before that, I want to run an alternative by you: would it make more sense to add this to defineContentScript (as an option like cssInjectionMode, matches, etc) instead of wxt.config.ts?

export default defineContentScript({
  iffeName: "example",
  // OR `globalName: string | boolean`, letting people disable the iffe name in the  output as well as give it a different name.

  main() {
    // ...
  }
})

In this version, it would default to true and the name would be generated based on the content script name, but in the next major version would could change the default to false so a name isn't even generated in the first place.

Originally posted by @aklinker1 in https://github.com/wxt-dev/wxt/pull/1897#pullrequestreview-3385640996

コントリビューターガイド