【发布时间】:2020-08-03 03:44:49
【问题描述】:
顺风版:v9.3.5
PostCSS 配置:
// postcss.config.js
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
...(process.env.NODE_ENV === 'production'
? {
'@fullhuman/postcss-purgecss': {
content: ['./components/**/*.js', './pages/**/*.js'],
defaultExtractor: content =>
content.match(/[\w-/:]+(?<!:)/g) || [],
},
}
: {}),
},
}
顺风配置:
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
tint: 'rgba(0,0,0,0.3)',
},
},
},
variants: {},
plugins: [],
}
样式在开发中完美地工作,但在生产中只有一些样式在工作。检查 build 文件夹中的 CSS 文件后,似乎某些 CSS 类没有被提取或可能被清除,因此导致应用程序的部分样式。
【问题讨论】:
标签: css reactjs next.js tailwind-css