nDmitry / grunt-autoprefixer

Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.
MIT License
795 stars 60 forks source link

autoprefix a minified file results in expanded css file #35

Closed rgruyters closed 10 years ago

rgruyters commented 10 years ago

I have a Gruntfile with the following tasks:

sass: {
  build: {
    options: {
      style: 'compressed',
      sourcemap: true,
      precision: 7
    },
    files: [{
      expand: true,
      cwd: '<%= assets.sass %>',
      src: ['*.scss'],
      dest: '<%= assets.css %>',
      ext: '.css'
    }]
  }
},

autoprefixer: {
  options: {
    browsers: ['last 2 version'],
  },
  no_dest: {
    src: '<%= assets.css %>/!(*.min).css'
  }
}

When I run this autoprefix expands the CSS file.

Is it possible to minify the file after autoprefixer has been finished? (or leave it minified) I know you can use cssmin (or csso) to minify the CSS file, but then the sourceMap entry gets removed from file.

For the record I have grunt-autoprefixer@0.4.2 installed.

rgruyters commented 10 years ago

Never mind. After updating to the latest version, 0.7.2, it keeps the file minified. (also updates the source map)

nDmitry commented 10 years ago

Yeah, that behavior was fixed in Autoprefixer 1.0.