Skip to content

Config to specify IIFE name or disable it altogether #2004

Closed

Description

@aklinker1

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 #1897 (review)

Activity

  1. changed the title [-]I like this idea, I am willing to merge this as-is.[/-] [+]Config to specify IIFE name or disable it altogether[/+] on Dec 16, 2025
  2. added
    good first issue
    on Dec 16, 2025
  3. aklinker1 commented on Dec 16, 2025

    @aklinker1
    MemberAuthor

    So this issue needs two PRs:

    1. Into main: Add the iifeName: boolean | string option and default it to true
    2. Into major: Change the default to false

    @jviney offered to implement this... 2 months ago, so I don't know if that offer still stands or if someone else can pick it up. I just created this issue to track it and make sure it's not forgotten since I think it's a really good idea.

  4. added this to the v1.0 milestone on Dec 16, 2025
  5. Riddhish1 commented on Dec 31, 2025

    @Riddhish1

    Hey @aklinker1 , I’d like to pick this up if no one is currently working on it. I’m planning to start with the PR to main (adding iifeName: boolean | string defaulting to true). Let me know if that sounds good.

  6. jviney commented on Dec 31, 2025

    @jviney
    Contributor

    Hey @aklinker1 , I’d like to pick this up if no one is currently working on it. I’m planning to start with the PR to main (adding iifeName: boolean | string defaulting to true). Let me know if that sounds good.

    I posted a draft of this a few days ago over here #2017. Any feedback welcome.

  7. aklinker1 commented on Feb 11, 2026

    @aklinker1
    MemberAuthor

    @jviney PR looks really good, left a few comments with some small changes.

  8. removed this from the v1.0 milestone on Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

contribution welcomegood first issue

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions