Specify browserslist uses 'defaults' #363
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Specify that the
browserslist
should use thedefaults
setting when building bundles.Motivation and Context
I noticed that unrelated script files were being altered during build. This is suboptimal since it bundles build changes into unrelated PRs making it more difficult to pin down where issues arise (if they do).
What Happened?
It looks like the
@wordpress/scripts
package has begun to fine tune the build targets to the specific browser support level in the handbook:This is manged in code in the
@wordpress/browserslist-config
package hereMeanwhile, the default set of targets in the
browserslist
package is larger and includes older user agents such that the resultant built files exclude newer functionality (e.g. variables are declared via thevar
keyword (instead ofconst
orlet
):This changed at some point after #354 landed since that PR did not result in any change to the built files. I confirmed that I was able to check out the hash prior to updating the
@wordpress/scripts
package (69bb168) and install deps / build our scripts without any changes to any versioned files.Alternatively
Perhaps we do want to follow the lead of the WordPress tooling and adopt a more modern set of targets. If that's what we decide, we can close this PR and PR the build as it is.
How Has This Been Tested?
Confirm the issue
origin/develop
npm i
npm run build
git status
/git diff
Confirm the fix
npm i
npm run build
git status
/git diff
Screenshots (if appropriate):
Types of changes
Dev tooling