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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't include webpack sourcemap files in packaged app #2573

Closed
3 tasks done
zac-jacobson opened this issue Oct 10, 2021 · 0 comments · Fixed by #2581
Closed
3 tasks done

Don't include webpack sourcemap files in packaged app #2573

zac-jacobson opened this issue Oct 10, 2021 · 0 comments · Fixed by #2581

Comments

@zac-jacobson
Copy link
Contributor

zac-jacobson commented Oct 10, 2021

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

We are using bugsnag to capture errors from our electron app. At build time, we need to upload the sourcemaps that webpack produces to bugsnag, however we don't want to ship our app with those sourcemaps.

At present we accomplish this by providing an ignore function in the packagerConfig, however this function is mostly a copy of what is already in @electron-forge/webpack-plugin

Proposed solution

Add a configuration option to WebpackPluginConfig, perhaps

ignoreSourcemaps?: boolean;

Update the forgeConfig.packagerConfig.ignore function in WebpackPlugin.resolveForgeConfig to, if the above-mentioned ignoreSourcemaps config is set, to return true if the filename ends in .map.

Alternatives considered

🤔 Is it ever appropriate to include sourcemaps in an electron app? Perhaps sourcemaps should always be ignored from packaging, or perhaps they should be ignored by default, and the configuration value would let them be included. Of course, a person could specify inline sourcemaps to include them, even if they were default-excluded.

Additional information

I'd be interesting in contributing a PR; I wanted to get feedback on if/how this feature should be exposed.

Thanks!

erickzhao pushed a commit that referenced this issue Apr 29, 2022
Restricts generated source map files from being included in the
packaged application by default. Provides an config option to include
them in again.

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

Successfully merging a pull request may close this issue.

1 participant