ker*_*aar 2 next.js tailwind-css
我将 tailwindcss 与 Next.JS 一起使用,并在每次第一次构建时都会出现此错误。它没有任何问题,但我不知道为什么我会得到这个。能否请你帮忙?
顺风.css
/* purgecss start ignore */
@tailwind base;
@tailwind components;
/* purgecss end ignore */
@tailwind utilities;
Run Code Online (Sandbox Code Playgroud)
postcss.config.js
const purgecss = [
'@fullhuman/postcss-purgecss',
{
// Specify the paths to all of the template files
content: [
'./layout/**/*.{js,jsx,ts,tsx}',
'./compoents/**/*.{js,jsx,ts,tsx}',
'./pages/**/*.{js,jsx,ts,tsx}'
],
// This is the function used to extract class names from the templates
defaultExtractor: (content) => {
// Capture as liberally as possible, including things like `h-(screen-1.5)`
const broadMatches = content.match(/[^<>"'`\\s]*[^<>"'`\\s:]/g) || [];
// Capture classes within other delimiters like .block(class="w-1/2") in Pug
const innerMatches = content.match(/[^<>"'`\\s.()]*[^<>"'`\\s.():]/g) || [];
return broadMatches.concat(innerMatches);
},
},
];
module.exports = {
plugins: [
'tailwindcss',
process.env.NODE_ENV === 'production' ? purgecss : undefined,
'postcss-preset-env',
],
};
Run Code Online (Sandbox Code Playgroud)
tailwind.config.js
module.exports = {
future: {
removeDeprecatedGapUtilities: true,
purgeLayersByDefault: true,
},
purge: [],
theme: {
extend: {},
},
variants: {},
plugins: [],
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1632 次 |
| 最近记录: |