Opened 6 years ago
Closed 6 years ago
#45201 closed defect (bug) (fixed)
Exclude JavaScript source maps from build
Reported by: | mcsf | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.0 | Priority: | normal |
Severity: | normal | Version: | 5.0 |
Component: | Build/Test Tools | Keywords: | fixed-5.0 |
Focuses: | Cc: |
Description
The nightly build, as obtained from https://wordpress.org/nightly-builds/wordpress-latest.zip, currently contains .map
files, source maps for 5.0's new JS packages. These aren't needed in the build and should be removed.
$ find . -name '*.map' | xargs du -hc 28K ./wp-includes/js/dist/hooks.js.map [32 more items...] 16K ./wp-includes/js/dist/viewport.js.map 5.5M total
Attachments (2)
Change History (20)
#2
@
6 years ago
The recent changes in #45145 that caused this are potentially going to be reverted which will resolve this issue I believe, @mcsf can you follow that ticket also and test again once those changes are reverted please.
#5
@
6 years ago
- Keywords reporter-feedback removed
This is related to #45156 and not #45145. The map files are still there as you can see in https://build.trac.wordpress.org/browser/branches/5.0/wp-includes/js/dist/.
#6
@
6 years ago
@ocean90: I seem to recall the map files being needed to extract translator comments. Is that correct? It looks like the comments are in the unminified JS files.
#7
@
6 years ago
@pento .map files are currently not parsed, see https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-make-core-pot.php?rev=7833#L99
I'm fine with removing them if possible.
#8
follow-up:
↓ 9
@
6 years ago
- Keywords has-patch needs-testing added
45201.diff makes the build happen without the map files. Can someone please test that it doesn't have any weird side effects?
#9
in reply to:
↑ 8
@
6 years ago
Replying to pento:
45201.diff makes the build happen without the map files. Can someone please test that it doesn't have any weird side effects?
Nothing weird observed. I can confirm .map
files are excluded.
The only exception can be found in the Twenty Nineteen directory:
$ find build -name '*.map' build/wp-content/themes/twentynineteen/style.css.map
I've uploaded 45201.2.diff to cover this.
#10
@
6 years ago
Good catch, thanks @mcsf.
It's fine to keep that file in src
, so I'll move that rule to not copy any .map
files from src
to build
, instead.
#13
@
6 years ago
- Keywords has-patch fixed-5.0 removed
Turns out there was a side effect: webpack wraps the code in an eval()
call when a devtool
isn't specified.
#16
@
6 years ago
- Keywords fixed-5.0 added
Okay, that reduced the nightly zip file from 18.3MB to 16.7MB. For comparison, the 4.9 nightly is 13.4MB.
I'd expect a similar size decrease in the release zip, dropping it from 13.6MB to 12MB. For comparison, the 4.9.8 release zip was 9.5MB.
I don't think there's much more space to save, the additional 3.5MB of zip is taken up by:
- Minified package JS/CSS files: 3.4MB
- Unminified package JS/CSS files: 7.5MB
- The size difference between Twenty Nineteen and Twenty Fifteen (the latter is removed from the 5.0 release zip): 700KB.
@atimmer and @omarreiss This seems like a follow up to #45145 and something we should do to reduce the zip size.
Increased zip size can be a contributing factor to updates failing, so anything we can do to keep it lower is a good thing.