我是vite.js构建工具,vue.js和tailwindcss: ^2.1.4
以前一切都正常,但现在我不知道我做了什么,清洗没有像预期的那样工作。即使在我的开发环境中,顺风类也开始清除。只有当我为生产建立项目时,它才会被清除。
假设我将mb-10 pt-10应用于div,要看到这一效果,我需要做两件事之一:
css文件定义中的individually)
.cust-class { @apply mb-10 pt-10 }然后mb-10 pt-10类将工作(共同或)
这是我的tailwind.config.js
module.exports = {
purge: ['./index.html', './src/**/*.{vue,js}'],
darkMode: false, // or 'media' or 'class'
theme: {
colors: {
transparent: 'transparent',
current: 'currentColor',
black: '#000',
white: '#fff',
},
extend: {},
},
variants: {
extend: {
backgroundColor: ['active'],
},
},
plugins: [],
};在其他项目中,我从来没有遇到过相同的配置问题。
谢谢你的帮助。
发布于 2021-06-18 10:26:33
这个问题是由于.env文件造成的,我最近添加了该文件:
我已经在这里定义了
NODE_ENV=production我把它换成了
NODE_ENV=development事情已经开始运作了。
https://stackoverflow.com/questions/68032254
复制相似问题