Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

parcel/config-webextension can build extensions incompatible with Firefox's Add-Ons Store #9560

Open
derenrich opened this issue Mar 1, 2024 · 2 comments

Comments

@derenrich
Copy link

馃悰 bug report

I am building a web extension at https://github.com/derenrich/wwwyzzerdd and I am using parcel to build it. The extension works in Chrome and FF but Mozilla will not allow me to upload the extension because some of the generated .js files are larger than 5MB.

See Mozilla's bug report at https://discourse.mozilla.org/t/bug-with-uploading-large-files-in-addon/85407/6

wwwyzzerdd ff error

馃帥 Configuration (.babelrc, package.json, cli command)

{
  "extends": "@parcel/config-webextension",
  "transformers": {
    "*.{ts,tsx}": ["@parcel/transformer-typescript-tsc"]
  },
  "validators": {
    "*.{ts,tsx}": ["@parcel/validator-typescript"]
  }  
}
{
    "compilerOptions": {
        "allowSyntheticDefaultImports": true,
        "jsx": "react",
        "outDir": "./dist/",
        "sourceMap": true,
        "strict": true,
        "isolatedModules": true,
        "noImplicitReturns": true,
        "noImplicitAny": true,
        "module": "esnext",
        "moduleResolution": "node",
        "target": "esnext",
        "allowJs": true,
        "baseUrl": "./src",
        "paths": {
            "~*": ["./*"]
        },
        "types": ["chrome"]
    },
    "include": [
        "src/**/*"
    ]
}

馃 Expected Behavior

Built extension should work on all browsers making files <5MB.

馃槸 Current Behavior

Dumps >5MB of data into a single file and fails to upload

馃拋 Possible Solution

To achieve this the extension should split the minimized js file across multiple 5MB files

馃敠 Context

I upgraded my dependencies and then the extension's files grew above 5MB and now I can only deploy new versions to Chrome. Unsure how to split this up more.

馃捇 Code Sample

馃實 Your Environment

Software Version(s)
Parcel 2.8.2
Node v15.14.0
npm/Yarn yarn=1.22.10
Operating System ubuntu
@derenrich
Copy link
Author

Ah. Passing --no-source-maps drastically reduces my build sizes. I guess that's the ticket though I guess maybe it should emit a warning when this happens? I'd also be fine just closing this.

@PLtier
Copy link

PLtier commented Apr 5, 2024

I have also arrived at the same conclusion to pass this argument. With source maps I get >100MB on my extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants