chore(build-system): replace Recess with PostCSS (#975)

pull/563/merge
Konstantin Azizov 2017-07-04 15:30:23 +03:00 committed by Anthony Lapenna
parent 07a0c4dfe3
commit c5ce45f588
2 changed files with 26 additions and 40 deletions

View File

@ -1,3 +1,6 @@
var autoprefixer = require('autoprefixer');
var cssnano = require('cssnano');
module.exports = function (grunt) { module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
@ -6,15 +9,14 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-html2js'); grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-shell'); grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-if'); grunt.loadNpmTasks('grunt-if');
grunt.loadNpmTasks('grunt-filerev'); grunt.loadNpmTasks('grunt-filerev');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-usemin'); grunt.loadNpmTasks('grunt-usemin');
grunt.loadNpmTasks('grunt-replace'); grunt.loadNpmTasks('grunt-replace');
grunt.loadNpmTasks('grunt-config'); grunt.loadNpmTasks('grunt-config');
grunt.loadNpmTasks('grunt-postcss');
grunt.registerTask('default', ['eslint', 'build']); grunt.registerTask('default', ['eslint', 'build']);
grunt.registerTask('build', [ grunt.registerTask('build', [
@ -23,7 +25,6 @@ module.exports = function (grunt) {
'if:linuxAmd64BinaryNotExist', 'if:linuxAmd64BinaryNotExist',
'html2js', 'html2js',
'useminPrepare:dev', 'useminPrepare:dev',
'recess:build',
'concat', 'concat',
'clean:tmpl', 'clean:tmpl',
'replace', 'replace',
@ -37,10 +38,9 @@ module.exports = function (grunt) {
'clean:all', 'clean:all',
'html2js', 'html2js',
'useminPrepare:release', 'useminPrepare:release',
'recess:build',
'concat', 'concat',
'postcss:build',
'clean:tmpl', 'clean:tmpl',
'cssmin',
'replace', 'replace',
'uglify', 'uglify',
'copy:assets', 'copy:assets',
@ -54,10 +54,9 @@ module.exports = function (grunt) {
'if:linux386BinaryNotExist', 'if:linux386BinaryNotExist',
'html2js', 'html2js',
'useminPrepare:release', 'useminPrepare:release',
'recess:build',
'concat', 'concat',
'postcss:build',
'clean:tmpl', 'clean:tmpl',
'cssmin',
'replace', 'replace',
'uglify', 'uglify',
'copy:assets', 'copy:assets',
@ -71,10 +70,9 @@ module.exports = function (grunt) {
'if:linuxAmd64BinaryNotExist', 'if:linuxAmd64BinaryNotExist',
'html2js', 'html2js',
'useminPrepare:release', 'useminPrepare:release',
'recess:build',
'concat', 'concat',
'postcss:build',
'clean:tmpl', 'clean:tmpl',
'cssmin',
'replace', 'replace',
'uglify', 'uglify',
'copy:assets', 'copy:assets',
@ -88,10 +86,9 @@ module.exports = function (grunt) {
'if:linuxArmBinaryNotExist', 'if:linuxArmBinaryNotExist',
'html2js', 'html2js',
'useminPrepare:release', 'useminPrepare:release',
'recess:build',
'concat', 'concat',
'postcss:build',
'clean:tmpl', 'clean:tmpl',
'cssmin',
'replace', 'replace',
'uglify', 'uglify',
'copy', 'copy',
@ -105,10 +102,9 @@ module.exports = function (grunt) {
'if:linuxArm64BinaryNotExist', 'if:linuxArm64BinaryNotExist',
'html2js', 'html2js',
'useminPrepare:release', 'useminPrepare:release',
'recess:build',
'concat', 'concat',
'postcss:build',
'clean:tmpl', 'clean:tmpl',
'cssmin',
'replace', 'replace',
'uglify', 'uglify',
'copy', 'copy',
@ -122,10 +118,9 @@ module.exports = function (grunt) {
'if:linuxPpc64leBinaryNotExist', 'if:linuxPpc64leBinaryNotExist',
'html2js', 'html2js',
'useminPrepare:release', 'useminPrepare:release',
'recess:build',
'concat', 'concat',
'postcss:build',
'clean:tmpl', 'clean:tmpl',
'cssmin',
'replace', 'replace',
'uglify', 'uglify',
'copy', 'copy',
@ -139,10 +134,9 @@ module.exports = function (grunt) {
'if:windowsAmd64BinaryNotExist', 'if:windowsAmd64BinaryNotExist',
'html2js', 'html2js',
'useminPrepare:release', 'useminPrepare:release',
'recess:build',
'concat', 'concat',
'postcss:build',
'clean:tmpl', 'clean:tmpl',
'cssmin',
'replace', 'replace',
'uglify', 'uglify',
'copy', 'copy',
@ -156,10 +150,9 @@ module.exports = function (grunt) {
'if:darwinAmd64BinaryNotExist', 'if:darwinAmd64BinaryNotExist',
'html2js', 'html2js',
'useminPrepare:release', 'useminPrepare:release',
'recess:build',
'concat', 'concat',
'postcss:build',
'clean:tmpl', 'clean:tmpl',
'cssmin',
'replace', 'replace',
'uglify', 'uglify',
'copy', 'copy',
@ -304,6 +297,10 @@ module.exports = function (grunt) {
} }
}, },
concat: { concat: {
css: {
src: ['<%= src.cssVendor %>', '<%= src.css %>'],
dest: '<%= distdir %>/css/<%= pkg.name %>.css'
},
dist: { dist: {
options: { options: {
process: true process: true
@ -358,27 +355,16 @@ module.exports = function (grunt) {
dest: '<%= distdir %>/js/angular.js' dest: '<%= distdir %>/js/angular.js'
} }
}, },
recess: { // TODO: not maintained, unable to preserve license comments, switch out for something better. postcss: {
build: { build: {
files: {
'<%= distdir %>/css/<%= pkg.name %>.css': ['<%= src.css %>'],
'<%= distdir %>/css/vendor.css': ['<%= src.cssVendor %>']
},
options: { options: {
compile: true, processors: [
noOverqualifying: false // TODO: Added because of .nav class, rename autoprefixer({browsers: 'last 2 versions'}), // add vendor prefixes
} cssnano() // minify the result
}, ]
min: {
files: {
'<%= distdir %>/css/<%= pkg.name %>.css': ['<%= src.css %>'],
'<%= distdir %>/css/vendor.css': ['<%= src.cssVendor %>']
}, },
options: { src: '<%= distdir %>/css/<%= pkg.name %>.css',
compile: true, dest: '<%= distdir %>/css/app.css'
compress: true,
noOverqualifying: false // TODO: Added because of .nav class, rename
}
} }
}, },
watch: { watch: {

View File

@ -22,9 +22,10 @@
"engines": { "engines": {
"node": ">= 0.8.4" "node": ">= 0.8.4"
}, },
"dependencies": {},
"devDependencies": { "devDependencies": {
"autoprefixer": "^7.1.1",
"bower": "^1.5.2", "bower": "^1.5.2",
"cssnano": "^3.10.0",
"eslint": "^3.19.0", "eslint": "^3.19.0",
"grunt": "~0.4.0", "grunt": "~0.4.0",
"grunt-cli": "^1.2.0", "grunt-cli": "^1.2.0",
@ -32,7 +33,6 @@
"grunt-contrib-clean": "~0.4.0", "grunt-contrib-clean": "~0.4.0",
"grunt-contrib-concat": "~0.1.3", "grunt-contrib-concat": "~0.1.3",
"grunt-contrib-copy": "~0.4.0", "grunt-contrib-copy": "~0.4.0",
"grunt-contrib-cssmin": "^1.0.2",
"grunt-contrib-jshint": "^1.1.0", "grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-uglify": "^0.9.2", "grunt-contrib-uglify": "^0.9.2",
"grunt-contrib-watch": "~0.3.1", "grunt-contrib-watch": "~0.3.1",
@ -40,7 +40,7 @@
"grunt-html2js": "~0.1.0", "grunt-html2js": "~0.1.0",
"grunt-if": "^0.1.5", "grunt-if": "^0.1.5",
"grunt-karma": "~0.4.4", "grunt-karma": "~0.4.4",
"grunt-recess": "~0.3", "grunt-postcss": "^0.8.0",
"grunt-replace": "^1.0.1", "grunt-replace": "^1.0.1",
"grunt-shell": "^1.1.2", "grunt-shell": "^1.1.2",
"grunt-usemin": "^3.1.1", "grunt-usemin": "^3.1.1",