Use '.min' in filenames of already minified js files in the Swagger module so they aren't getting minified again in production, fixes #16927 - for Magento 2.2 #17626
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.
Please: do not forwardport this PR to 2.3,
the solution for 2.3 is different and much cleaner, and, it already exists: #17627Description
The Magento Swagger module contains already minified js files:
This PR marks them to not be minified again during static content deploy, because they get changed in a way that they are no longer valid JS.This PR renames them so they contain
.min
and reference them as such from the layout xml file as well. This way they don't get minified again in production mode when minification is enabled.I've already gone ahead and created a fix for Magento 2.3 as well
, since the solution is very different and much cleaner, this is due to #13687 which only exists in 2.3PR for Magento 2.3: #17627
Fixed Issues (if relevant)
Manual testing scenarios
bin/magento config:set dev/js/minify_files 1
bin/magento deploy:mode:set production
Uncaught SyntaxError: Invalid regular expression flag
&Uncaught ReferenceError: SwaggerUIBundle is not defined
Contribution checklist