尾风类未使用ViewComponents Rails编译



如果你想阅读所有带有图片的帖子,我可以在帖子中使用图片https://github.com/rails/tailwindcss-rails/issues/201

我一直在测试ViewComponents,我发现了这个ViewComponents+Tailiwnd指南。

示例该指南使用CDN来使用顺风,一切都很好。

我的问题是,使用tailwindcss rails,从组件注入的顺风类不会在视图中呈现。

我从Procfile 启动服务器

错误:

类加载在Html中,但不加载在css 中

我知道错误在哪里,但如果不使用顺风CDN,我就找不到解决方案。

PD:我也使用过rails资产:clobber

确保将路径数组中的组件文件夹添加到Tailwind配置

config/tailwind.config.js
module.exports = {
content: [
'./public/*.html',
'./app/helpers/**/*.rb',
'./app/javascript/**/*.js',
'./app/views/**/*.{erb,haml,html,slim}',
'./app/components/**/*' //This is the new Entry
],
...

最新更新