mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-15 04:29:37 +01:00
fix(module): transform vue files to detect multi-line components
This commit is contained in:
@@ -141,7 +141,7 @@ export const generateSafelist = (colors: string[]) => {
|
||||
export const customSafelistExtractor = (prefix, content: string, colors: string[]) => {
|
||||
const classes = []
|
||||
const regex = /<(\w+)\s+[^>:]*color=["']([^"']+)["'][^>]*>/gs
|
||||
const matches = [...content.matchAll(regex)]
|
||||
const matches = content.matchAll(regex)
|
||||
|
||||
for (const match of matches) {
|
||||
const [, component, color] = match
|
||||
|
||||
@@ -148,6 +148,11 @@ export default defineNuxtModule<ModuleOptions>({
|
||||
resolve(runtimeDir, 'components/**/*.{vue,mjs,ts}'),
|
||||
resolve(runtimeDir, '*.{mjs,js,ts}')
|
||||
],
|
||||
transform: {
|
||||
vue: (content) => {
|
||||
return content.replaceAll(/(?:\r\n|\r|\n)/g, ' ')
|
||||
}
|
||||
},
|
||||
extract: {
|
||||
vue: (content) => {
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user