Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #6273 Exclude JS module type from minification #6277

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Tabrisrp
Copy link
Contributor

Description

Exclude type="module" scripts from JS mifinication

Fixes #6273

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Is the solution different from the one proposed during the grooming?

XS issue, no grooming

Checklists

Generic development checklist

  • My code follows the style guidelines of this project, with adapted comments and without new warnings.
  • I have added unit and integration tests that prove my fix is effective or that my feature works.
  • The CI passes locally with my changes (including unit tests, integration tests, linter).

Test summary

  • I triggered all changed lines of code at least once without new errors/warnings/notices.

@Tabrisrp Tabrisrp requested a review from a team November 20, 2023 16:14
@Tabrisrp Tabrisrp self-assigned this Nov 20, 2023
@Tabrisrp Tabrisrp added module: minify JS type: bug Indicates an unexpected problem or unintended behavior labels Nov 20, 2023
@Tabrisrp Tabrisrp linked an issue Nov 20, 2023 that may be closed by this pull request
Copy link
Contributor

@CrochetFeve0251 CrochetFeve0251 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems valid. However @piotrbak already created a PR to create a exclusion list maintained by the backend for that issue : https://github.com/wp-media/rucss-backend/issues/83

@piotrbak
Copy link
Contributor

@CrochetFeve0251 @Tabrisrp Apologies, thought that the grooming will happen. I added this issue to the backen repository, so we could move this part there:

false !== strpos( $tag[0], 'data-minify=' )
||
false !== strpos( $tag[0], 'data-no-minify=' )
||
preg_match( '/type=(?<quote>[\'"])module\g<quote>/', $tag[0] )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: minify JS type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude js scripts with type="module" from JS minification
3 participants