小编Jim*_*Jim的帖子

TailwindCSS 3 + Symfony / webpack Encore 没有样式?

我在 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)

symfony webpack postcss webpack-encore tailwind-css

3
推荐指数
1
解决办法
1892
查看次数

标签 统计

postcss ×1

symfony ×1

tailwind-css ×1

webpack ×1

webpack-encore ×1