MinificationPlugin.php 815 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Dotdigitalgroup\Email\Plugin;
  3. /**
  4. * Class MinificationPlugin
  5. *
  6. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  7. */
  8. class MinificationPlugin
  9. {
  10. /**
  11. * Exclude external js from minification
  12. *
  13. * @param \Magento\Framework\View\Asset\Minification $subject
  14. * @param callable $proceed
  15. * @param string $contentType
  16. *
  17. * @return array
  18. */
  19. public function aroundGetExcludes(
  20. \Magento\Framework\View\Asset\Minification $subject,
  21. callable $proceed,
  22. $contentType
  23. ) {
  24. $result = $proceed($contentType);
  25. //Content type can be css or js
  26. if ($contentType == 'js') {
  27. $result[] = 'trackedlink.net/_dmpt.js';
  28. $result[] = 'trackedlink.net/_dmmpt.js';
  29. }
  30. return $result;
  31. }
  32. }