From 51140036e02b17b6ba7d9ce2e398bdb6cdf6c96d Mon Sep 17 00:00:00 2001 From: Guillaume Demesy Date: Fri, 11 Mar 2016 22:11:26 +0100 Subject: [PATCH] Issue #900 - grunt-cssnext is deprecated, added postcss-cssnext --- Gruntfile.js | 4 ++-- grunt-tasks/cssnext.js | 16 ++++++++++------ grunt-tasks/watch.js | 2 +- package.json | 8 +++++++- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d77064b24..1e9bed5d9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -23,11 +23,11 @@ module.exports = function(grunt) { // Default task. grunt.registerTask('default', [ - 'checkDependencies', 'eslint', 'concat', 'uglify','cssnext', 'cssmin' + 'checkDependencies', 'eslint', 'concat', 'uglify','postcss', 'cssmin' ]); // Task used before doing a deploy (same as default, but does image optimization) grunt.registerTask('deploy', [ - 'checkDependencies', 'eslint', 'concat', 'uglify','cssnext', 'cssmin', 'imagemin' + 'checkDependencies', 'eslint', 'concat', 'uglify','postcss', 'cssmin', 'imagemin' ]); }; diff --git a/grunt-tasks/cssnext.js b/grunt-tasks/cssnext.js index a43b8e020..492cdb225 100644 --- a/grunt-tasks/cssnext.js +++ b/grunt-tasks/cssnext.js @@ -3,13 +3,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ module.exports = function(grunt) { - grunt.config('cssnext', { + grunt.config('postcss', { options: { - sourcemap: true, - url : false, - browsers: ['ff >= 4', 'ie >= 8', 'safari >= 5.1', 'opera >= 12', 'chrome >=10'], - import: { path: ['node_modules'] }, - messages: {browser: false, console: true} + map: true, + processors: [ + require('postcss-import')(), + require('postcss-cssnext')({ + browsers: ['ff >= 20', 'ie >= 10', 'safari >= 7', 'opera >= 12', 'chrome >=30'], + }), + require('postcss-browser-reporter')(), + require('postcss-reporter')(), + ] }, dist: { files: { diff --git a/grunt-tasks/watch.js b/grunt-tasks/watch.js index bbe3232d8..e7672b10b 100644 --- a/grunt-tasks/watch.js +++ b/grunt-tasks/watch.js @@ -6,7 +6,7 @@ module.exports = function(grunt) { grunt.config('watch', { css:{ files: '<%= cssPath %>/development/**/*.css', - tasks: ['cssnext'] + tasks: ['postcss'] }, script:{ files: '<%= jshint.beforeconcat %>', diff --git a/package.json b/package.json index 16a3a57a9..234f82b50 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,16 @@ "grunt-contrib-imagemin": "~1.0.0", "grunt-contrib-uglify": "~0.2.7", "grunt-contrib-watch": "~0.5.3", - "grunt-cssnext": "^1.0.0", "grunt-eslint": "^17.3.1", + "grunt-postcss": "^0.8.0", "intern": "2.2.0", "load-grunt-tasks": "~0.6.0", + "postcss": "^5.0.19", + "postcss-browser-reporter": "^0.4.0", + "postcss-cssnext": "^2.4.0", + "postcss-import": "^8.0.2", + "postcss-reporter": "^1.3.3", + "postcss-url": "^5.1.1", "suitcss-utils-align": "^0.2.0", "suitcss-utils-display": "^0.4.0" }