Electron-react-boilerplate: Source maps included in production asar

Created on 17 Nov 2018  路  3Comments  路  Source: electron-react-boilerplate/electron-react-boilerplate

Prerequisites

  • [x] Using yarn
  • [x] Using an up-to-date master branch
  • [x] Using latest version of devtools. See wiki for howto update
  • [x] Link to stacktrace in a Gist (for bugs)
  • [x] For issue in production release, devtools output of DEBUG_PROD=true yarn build && yarn start
  • [x] Tried solutions mentioned in #400

Expected Behavior

When I package my app, install it, and then un-asar the package...

$ yarn global add asar
$ asar extract /Applications/ElectronReact.app/Contents/Resources/app.asar /tmp/erb-0.17
$ ls -alh /tmp/erb-0.17/app/**/**.map

I see source maps are being distributed:
image

Sometimes these sourcemaps can get large... i.e. 17MB

They increase the size of the download. It seems that anybody building an Electron app would be uploading source maps to a bug reporting system at build time.


Current Behavior

.map files are in the asar.

Possible Solution

.map files should not be in the asar.
The electron-builder config should be updated or alternatively CleanWebpackPlugin should be used to delete sourcemaps at the beginning of a production build.

Steps to Reproduce (for bugs)


$ cd electron-react-boilerplate
$ yarn dev # then quit
$ yarn package # then install ./release/ElectronReact-0.17.0.dmg
$ yarn global add asar
$ asar extract /Applications/ElectronReact.app/Contents/Resources/app.asar /tmp/erb-0.17
$ ls -alh /tmp/erb-0.17/app/**/**.map

Context

Increases app size. Testing on master. In my real world app source maps are 4MB of unnecessary space being distributed.

Your Environment

  • Node version : 10.13.0
  • Version or Branch used : master
  • Operating System and version : macOS 10.14
  • Link to your project : n/a
wontfix

All 3 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

why is this closed?

In addition, you can view the source code through the map file, which is not safe.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SirWindfield picture SirWindfield  路  3Comments

ceemion picture ceemion  路  3Comments

kennetpostigo picture kennetpostigo  路  3Comments

MonkeyInWind picture MonkeyInWind  路  3Comments

fandy picture fandy  路  3Comments