@@ -6,12 +6,12 @@ module.exports = function( grunt ) {
66 require ( 'load-grunt-tasks' ) ( grunt ) ;
77
88 grunt . initConfig ( {
9- // Watch for changes and trigger autoprefixer , cssmin and uglify
10- // Ref. https://www.npmjs.com/package/grunt-contrib-watch
9+ // Watch for changes and trigger postcss , cssmin and uglify
10+ // Ref. https://www.npmjs.com/package/grunt-contrib-watch
1111 watch : {
1212 css : {
13- files : [ 'admin/css/rt-transcoder-admin.css' ] ,
14- tasks : [ 'autoprefixer ' , 'cssmin' ]
13+ files : [ 'admin/css/rt-transcoder-admin.css' , 'admin/css/rt-transcoder-client.css' ] ,
14+ tasks : [ 'postcss ' , 'cssmin' ]
1515 } ,
1616 js : {
1717 files : [
@@ -35,15 +35,15 @@ module.exports = function( grunt ) {
3535 }
3636 }
3737 } ,
38- // Autoprefixer - Parse CSS and add vendor-prefixed CSS properties using the Can I Use database.
39- // Ref. https://www.npmjs.com/package/grunt-autoprefixer
40- autoprefixer : {
38+ // PostCSS with autoprefixer
39+ // Ref. https://www.npmjs.com/package/grunt-postcss
40+ postcss : {
41+ options : {
42+ config : {
43+ path : './postcss.config.js'
44+ }
45+ } ,
4146 dist : {
42- options : {
43- browsers : [ 'last 2 versions' , 'ie 9' , 'ie 10' , 'ios 6' , 'android 4' ] ,
44- expand : true ,
45- flatten : true
46- } ,
4747 files : {
4848 'admin/css/rt-transcoder-admin.css' : 'admin/css/rt-transcoder-admin.css' ,
4949 'admin/css/rt-transcoder-client.css' : 'admin/css/rt-transcoder-client.css'
@@ -94,11 +94,11 @@ module.exports = function( grunt ) {
9494 target : {
9595 files : [ {
9696 src : [
97- '*.php' ,
98- '**/*.php' ,
99- '!node_modules/**' ,
100- '!tests/**'
101- ] , //All php
97+ '*.php' ,
98+ '**/*.php' ,
99+ '!node_modules/**' ,
100+ '!tests/**'
101+ ] , //All php
102102 expand : true
103103 } ]
104104 }
@@ -114,11 +114,11 @@ module.exports = function( grunt ) {
114114 mainFile : 'index.php' , // Main project file.
115115 potFilename : 'transcoder.pot' , // Name of the POT file.
116116 potHeaders : { // Headers to add to the generated POT file.
117- poedit : true , // Includes common Poedit headers.
118- 'Last-Translator' : 'Transcoder <support@rtcamp.com>' ,
119- 'Language-Team' : 'Transcoder <support@rtcamp.com>' ,
120- 'report-msgid-bugs-to' : 'http://community.rtcamp.com/' ,
121- 'x-poedit-keywordslist' : true // Include a list of all possible gettext functions.
117+ poedit : true , // Includes common Poedit headers.
118+ 'Last-Translator' : 'Transcoder <support@rtcamp.com>' ,
119+ 'Language-Team' : 'Transcoder <support@rtcamp.com>' ,
120+ 'report-msgid-bugs-to' : 'http://community.rtcamp.com/' ,
121+ 'x-poedit-keywordslist' : true // Include a list of all possible gettext functions.
122122 } ,
123123 type : 'wp-plugin' , // Type of project (wp-plugin or wp-theme).
124124 updateTimestamp : true // Whether the POT-Creation-Date should be updated without other changes.
@@ -127,6 +127,10 @@ module.exports = function( grunt ) {
127127 }
128128
129129 } ) ;
130- // Register task
131- grunt . registerTask ( 'default' , [ 'autoprefixer' , 'cssmin' , 'uglify' , 'checktextdomain' , 'makepot' , 'watch' ] ) ;
132- } ;
130+ // Register default task
131+ grunt . registerTask ( 'default' , [ 'postcss' , 'cssmin' , 'uglify' , 'checktextdomain' , 'makepot' ] ) ;
132+ // Register a CSS-only task
133+ grunt . registerTask ( 'css' , [ 'postcss' , 'cssmin' ] ) ;
134+ // Register a JS-only task
135+ grunt . registerTask ( 'js' , [ 'uglify' ] ) ;
136+ } ;
0 commit comments