public static function generateScriptTag($src, $async=false, $mtime=false, $hash=null, $crossorigin=null)
	{
		// Add the filemtime if not given and not an external file
		if ($mtime === null && !preg_match('@^https?://@', $src))
		{
			$container = System::getContainer();
			$rootDir = $container->getParameter('kernel.project_dir');

			if (file_exists($rootDir . '/' . $src))
			{
				$mtime = filemtime($rootDir . '/' . $src);
			}
			else
			{
				$webDir = StringUtil::stripRootDir($container->getParameter('contao.web_dir'));

				// Handle public bundle resources in web/
				if (file_exists($rootDir . '/' . $webDir . '/' . $src))
				{
					$mtime = filemtime($rootDir . '/' . $webDir . '/' . $src);
				}
			}
		}

		if ($mtime)
		{
			$src .= '?v=' . substr(md5($mtime), 0, 8);
		}

		return '<script src="' . $src . '"' . ($async ? ' async' : '') . ($hash ? ' integrity="' . $hash . '"' : '') . ($crossorigin ? ' crossorigin="' . $crossorigin . '"' : '') . '></script>';
	}