public JsOptimizer::clean($contents)
Processes the contents of a javascript asset for cleanup.
string $contents: The contents of the javascript asset.
string Contents of the javascript asset.
Overrides AssetOptimizerInterface::clean
public function clean($contents) { // Remove JS source and source mapping urls or these may cause 404 errors. $contents = preg_replace('/\/\/(#|@)\s(sourceURL|sourceMappingURL)=\s*(\S*?)\s*$/m', '', $contents); return $contents; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Asset!JsOptimizer.php/function/JsOptimizer::clean/8.1.x