C-Lodder / grunt-postcss

Apply several post-processors to your CSS using PostCSS.
MIT License
39 stars 7 forks source link

Fatal error: plugin is not a function #130

Closed quintendewilde closed 1 year ago

quintendewilde commented 1 year ago

Hi, I need help,

I get this error when grunt build. What's going wrong and what do I need to change?

Running "postcss:dist" (postcss) task
Fatal error: plugin is not a function

this is the configuration. Last commented was the original config, I searched for the issue and the tried the uncommented version.

postcss: {
            options: {
                map: true, // inline sourcemaps

                processors: [
                    require('pixrem')(), // add fallbacks for rem units
                    require('autoprefixer')({ browsers: ['last 2 versions'] }), // add vendor prefixes
                    require('cssnano')() // minify the result
                ]
            },
            dist: {
                src: 'dist/css/*.css'
            }
        },

        /*        postcss: {
                    options: {
                        processors: [
                            require('pixrem')(), // add fallbacks for rem units
                            require('autoprefixer')(), // add vendor prefixes
                            require('cssnano')() // minify the result
                        ]
                    },
                    dist: {
                        src: 'dist/css/main.css'
                    }
                },
        */
C-Lodder commented 1 year ago

Hi @quintendewilde

The last release of pixrem the package was August 2016 and only supports PostCSS v7.x. You will need to find an alternative to this package.