nDmitry / grunt-postcss

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

Autoprefixer does not seem to work anymore #117

Closed dariusrosendahl closed 7 years ago

dariusrosendahl commented 7 years ago

Hi!

We've been using grunt-postcss + autoprefixer in combination with GruntJS for a long time. Since last friday it's come to our attention that autoprefixer does not work anymore.

It does generate a file, but without any prefixes:

2017-10-09 11_40_17-gruntfile js - castlecss-docs - visual studio code - insiders

Pixrem and cssnano still work like a charm. We can't seem to get autoprefixer to work however.

Our gruntfile:

Grunt-sass:

// Compile Sass to CSS and produce SoureMaps;
        sass: {
            dist: {
                options: {
                    sourceMap: false,
                    outputStyle: 'uncompressed'
                },
                files: [{
                    src: 'scss/main.scss',
                    dest: 'dist/css/styles.min.css',
                    ext: '.css'
                }]
            }
        },

PostCSS:

// PostCSS for adding prefixers and setting rem to pixels;
        postcss: {
            dist: {
                src: 'dist/css/styles.min.css'
            },
            options: {
                map: false,
                // or
                // map: {
                //  inline: false, // save all sourcemaps as separate files...
                //  annotation: 'dist/css/' // ...to the specified directory
                // },

                processors: [
                    require('pixrem')( { atrules: true }), // add fallbacks for rem units
                    require('autoprefixer')( { browsers: ['last 2 versions', 'android >= 4.4', 'ie>7'] }), // add vendor prefixes
                    require('cssnano')() // minify the result
                ]
            },
        },

Dependencies (all up to date):

"dependencies": {
    "autoprefixer": "^7.1.5",
    "castlecss-breadcrumbs": "^1.1.1",
    "castlecss-buttons": "^1.0.1",
    "castlecss-core": "^2.5.0",
    "castlecss-forms": "^1.0.10",
    "castlecss-icons": "^1.0.2",
    "castlecss-notifications": "^1.0.1",
    "cssnano": "^3.10.0",
    "grunt": "^1.0.1",
    "grunt-browser-sync": "^2.2.0",
    "grunt-contrib-watch": "^1.0.0",
    "grunt-nunjucks-2-html": "^2.1.0",
    "grunt-postcss": "^0.9.0",
    "grunt-sass": "^2.0.0",
    "jit-grunt": "^0.10.0",
    "nunjucks": "^3.0.1",
    "pixrem": "^4.0.1",
    "webpack": "^3.6.0"
  },

Could you point us in the right direction?

dariusrosendahl commented 7 years ago

It had something to do with the /*! autoprefixer: on */ comment: https://github.com/postcss/autoprefixer/issues/920