我使用 Vite 创建了一个 vanilla js 项目,并按照文档所述安装了 Tailwind。当我在开发模式下运行时,类可以工作,但是当我构建 dist 文件夹并为该构建提供服务时,它就不能工作。
我的 postcss.config.js 是这样的
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Run Code Online (Sandbox Code Playgroud)
我的顺风配置是这样的
module.exports = {
purge: [
'./src/**/*.html',
'./src/**/*.js',
],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [],
}
Run Code Online (Sandbox Code Playgroud)