스크립트 자동 압축 사용 시 import 구문 인식 문제 수정

This commit is contained in:
dewekk 2023-11-23 16:50:55 +09:00 committed by GitHub
parent d78b8e8415
commit b82585058c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -387,7 +387,7 @@ class Formatter
// Convert all paths in LESS and SCSS imports, too.
$dirname = dirname($filename);
$import_type = ends_with('.scss', $filename) ? 'scss' : 'normal';
$content = preg_replace_callback('/@import\s+([^\r\n]+);(?=[\r\n$])/', function($matches) use($dirname, $filename, $target_filename, $import_type, &$imported_list, &$imported_urls) {
$content = preg_replace_callback('/@import\s+([^\r\n]+);[\r\n]*/', function($matches) use($dirname, $filename, $target_filename, $import_type, &$imported_list, &$imported_urls) {
if (preg_match('!^url\([\'"]?((?:https?:)?//[^()\'"]+)!i', $matches[1], $urlmatches))
{
$imported_urls[] = $urlmatches[1];