diff --git a/internal/filesystem/asset_handler.go b/internal/filesystem/asset_handler.go
index 35a2fc5..6fe1a85 100644
--- a/internal/filesystem/asset_handler.go
+++ b/internal/filesystem/asset_handler.go
@@ -9,11 +9,40 @@ import (
"net/url"
"os"
"path/filepath"
+ "regexp"
"strings"
"sync"
"time"
)
+// 预编译正则表达式(避免每次调用重复编译)
+var (
+ // CSS 相关
+ cssImportRegex = regexp.MustCompile(`@import\s+(?:url\s*\(\s*)?["']([^"']+)["']\s*\)?\s*;`)
+ cssUrlRegex = regexp.MustCompile(`url\(\s*["']?([^"')]+)["']?\s*\)`)
+
+ // HTML 标签
+ htmlLinkTagRegex = regexp.MustCompile(`]*)>`)
+ htmlScriptTagRegex = regexp.MustCompile(`
+`
+
+ // 在