Next.JS->提供了一个空的PostCSS插件

问题描述

我正在将tailwindcss与Next.JS结合使用,并在每次首次构建时均收到此错误。它没有任何问题,但我不知道为什么我要得到这个。你能帮忙吗?

tailwind.css

    /* purgecss start ignore */
@tailwind  base;
@tailwind  components;
/* purgecss end ignore */
@tailwind  utilities;

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,'./pages/**/*.{js,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',],};

tailwind.config.js

module.exports = {
  future: {
    removeDeprecatedGapUtilities: true,purgeLayersByDefault: true,purge: [],theme: {
    extend: {},variants: {},plugins: [],}

解决方法

From this article

运行npm run dev时,您可能会收到有关“提供了空PostCSS插件”的警告。该警告是一种{@ {1}}返回postcss.config.js而不是PurgeCSS的假象,当您不在生产环境中时。可以安全地忽略它。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...