@@ -70,7 +70,17 @@ module.exports = function (grunt) {
7070 '<%%= yeoman.client %>/{app,components}/**/*.mock.js'
7171 ] ,
7272 tasks : [ 'newer:jshint:all' , 'karma' ]
73- } , < % if ( filters . sass ) { % >
73+ } , < % if ( filters . stylus ) { % >
74+ injectStylus : {
75+ files : [
76+ '<%%= yeoman.client %>/{app,components}/**/*.styl' ] ,
77+ tasks : [ 'injector:stylus' ]
78+ } ,
79+ stylus : {
80+ files : [
81+ '<%%= yeoman.client %>/{app,components}/**/*.styl' ] ,
82+ tasks : [ 'stylus' , 'autoprefixer' ]
83+ } , < % } % > < % if ( filters . sass ) { % >
7484 injectSass : {
7585 files : [
7686 '<%%= yeoman.client %>/{app,components}/**/*.{scss,sass}' ] ,
@@ -394,13 +404,15 @@ module.exports = function (grunt) {
394404 concurrent: {
395405 server : [ < % if ( filters . coffee ) { % >
396406 'coffee' , < % } %> < % if ( filters . jade ) { % >
397- 'jade',< % } % > < % if ( filters . sass ) { % >
407+ 'jade',< % } % > < % if ( filters . stylus ) { % >
408+ 'stylus',< % } % > < % if ( filters . sass ) { % >
398409 'sass',< % } % > < % if ( filters . less ) { % >
399410 'less',< % } % >
400411 ],
401412 test: [< % if ( filters . coffee ) { % >
402413 'coffee',< % } % > < % if ( filters . jade ) { % >
403- 'jade',< % } % > < % if ( filters . sass ) { % >
414+ 'jade',< % } % > < % if ( filters . stylus ) { % >
415+ 'stylus',< % } % > < % if ( filters . sass ) { % >
404416 'sass',< % } % > < % if ( filters . less ) { % >
405417 'less',< % } % >
406418 ],
@@ -415,7 +427,8 @@ module.exports = function (grunt) {
415427 } ,
416428 dist: [< % if ( filters . coffee ) { % >
417429 'coffee',< % } % > < % if ( filters . jade ) { % >
418- 'jade',< % } % > < % if ( filters . sass ) { % >
430+ 'jade',< % } % > < % if ( filters . stylus ) { % >
431+ 'stylus',< % } % > < % if ( filters . sass ) { % >
419432 'sass',< % } % > < % if ( filters . less ) { % >
420433 'less',< % } % >
421434 'imagemin',
@@ -499,6 +512,23 @@ module.exports = function (grunt) {
499512 ext : '.js'
500513 } ]
501514 }
515+ } ,< % } % > < % if ( filters . stylus ) { % >
516+
517+ // Compiles Stylus to CSS
518+ stylus: {
519+ server : {
520+ options : {
521+ paths : [
522+ '<%%= yeoman.client %>/bower_components' ,
523+ '<%%= yeoman.client %>/app' ,
524+ '<%%= yeoman.client %>/components'
525+ ] ,
526+ "include css" : true
527+ } ,
528+ files : {
529+ '.tmp/app/app.css' : '<%%= yeoman.client %>/app/app.styl'
530+ }
531+ }
502532 } ,< % } % > < % if ( filters . sass ) { % >
503533
504534 // Compiles Sass to CSS
@@ -557,7 +587,26 @@ module.exports = function (grunt) {
557587 '!{.tmp,<%%= yeoman.client %>}/{app,components}/**/*.mock.js' ]
558588 ]
559589 }
560- } ,< % if ( filters . sass ) { % >
590+ } ,< % if ( filters . stylus ) { % >
591+
592+ // Inject component styl into app.styl
593+ stylus: {
594+ options : {
595+ transform : function ( filePath ) {
596+ filePath = filePath . replace ( '/client/app/' , '' ) ;
597+ filePath = filePath . replace ( '/client/components/' , '' ) ;
598+ return '@import \'' + filePath + '\';' ;
599+ } ,
600+ starttag : '// injector' ,
601+ endtag : '// endinjector'
602+ } ,
603+ files : {
604+ '<%%= yeoman.client %>/app/app.styl' : [
605+ '<%%= yeoman.client %>/{app,components}/**/*.styl' ,
606+ '!<%%= yeoman.client %>/app/app.styl'
607+ ]
608+ }
609+ } ,< % } % > < % if ( filters . sass ) { % >
561610
562611 // Inject component scss into app.scss
563612 sass: {
0 commit comments