wxt-dev/wxt

Config to specify IIFE name or disable it altogether

已關閉

#2,004 建立於 2025年12月16日

 (4 則留言) (0 個反應) (1 位負責人)TypeScript (511 個分叉)user submission
contribution welcomegood first issue

倉庫指標

星標
 (9,861 顆星)
PR 合併指標
 (平均合併 11天 22小時) (30 天內合併 51 個 PR)

描述

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

貢獻者指南