gpt4 book ai didi

tailwind-css - 如何处理 Tailwind & PurgeCSS 和很多不同的文件夹?

转载 作者:行者123 更新时间:2023-12-04 03:41:14 27 4
gpt4 key购买 nike

我一直在使用带有“清除”选项的 Tailwind 来使最终的 css 文件更小且成功。但是,我一直想知道我的方法的效率。我正在处理有很多子文件夹的项目,我都指定如下:

 purge: {
layers: ['components', 'utilities', 'base'],
content: [
'../A.Umb.E.Platform.Frontend/Assets/**/*.css',
'../A.Umb.E.Platform.Vue/src/Apps/ESearch/*.vue',
'../A.Umb.E.Platform.Vue/src/Apps/ESearch/Components/*.vue',
'../A.Umb.E.Platform.Vue/src/Apps/HSearch/*.vue',
'../A.Umb.E.Platform.Vue/src/Apps/HSearch/Components/*.vue',
'../A.Umb.E.Platform.Web/Views/**/*.cshtml',
'../A.Umb.E.Platform.Web/Views/**/**/*.cshtml',
'../A.Umb.E.Platform.Web/Views/**/**/**/*.cshtml',
'../A.Umb.E.Platform.Web/Views/**/**/**/**/*.cshtml',

]
}
我一直在寻找这种低效方法的解决方案,但我所能找到的只是在同一文件夹中只有几个 html 或 vue 文件的小型项目的示例。所以我的问题是:有没有办法更有效地做到这一点,还是我必须像我已经做的那样做?

最佳答案

您不必针对每个子文件夹,即 glob模式将为您匹配那些。使用 **将匹配零个或多个文件夹。

purge: {
layers: ['components', 'utilities', 'base'],
content: [
'../A.Umb.E.Platform.Frontend/Assets/**/*.css',
'../A.Umb.E.Platform.Vue/src/Apps/**/*.vue',
'../A.Umb.E.Platform.Web/Views/**/*.cshtml'
]
}

关于tailwind-css - 如何处理 Tailwind & PurgeCSS 和很多不同的文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65996174/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com