我在 symfony 6 应用程序中更新到 TailwindCSS 3。当我编译样式表时,没有错误(编译成功),但所有顺风类样式都不起作用。我注意到 tailwind 的导入似乎不是从 @tailwindcss 调用翻译的(它们只是按原样包含在浏览器中)。也许是 postCSS 问题?
webpack.config.js:
const Encore = require('@symfony/webpack-encore');
const path = require('path');
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}
Encore
// directory where compiled assets will be stored
.setOutputPath('public/build/')
// public path used by the web server to access the output path
.setPublicPath('/build') …Run Code Online (Sandbox Code Playgroud)