Exclude js scripts with type="module" from JS minification #6273
Labels
effort: [XS]
< 1 day of estimated development time
module: minify JS
priority: low
Issues that can wait
type: enhancement
Improvements that slightly enhance existing functionality and are fast to implement
Before submitting an issue please check that you’ve completed the following steps:
yes - Made sure you’re on the latest version
yes - Used the search feature to ensure that the bug hasn’t been reported before
Describe the bug
When the option “Minify JavaScript files” is enabled, and scripts with
type="module"
are moved to the min folder, is likely to cause 404 errors because a a JS file with this type is likely to have import statemets, and changing the path where the expected module is located will break these linksPer customer feedback:
Example code. the files
./localization.d6c03d4a.js
,./selectors.e37ac126.js
and./vue.16a54326.js
with cause 404:To Reproduce
Steps to reproduce the behavior:
./localization.d6c03d4a.js
,./selectors.e37ac126.js
and./vue.16a54326.js
Expected behavior
we should exclude
type="module"
from minificationScreenshots
Additional context
Slack: https://wp-media.slack.com/archives/C43T1AYMQ/p1699483184373919
ticket: https://secure.helpscout.net/conversation/2414653718/453464?folderId=2683093
Acceptance Criteria (for WP Media team use only)
The text was updated successfully, but these errors were encountered: