admin管理员组

文章数量:1425671

I have an existing project, but I need to add sass/pass so that grunt will automatically pile it when I use the grunt server mand.

Does anyone know how I do this?

Edit: I've managed to add grunt sas/passs to the project, but I need to configure gruntfile.js to watch and pile the css. All I've done to add sass support is to run npm install grunt-contrib-sass --save-dev.

I have an existing project, but I need to add sass/pass so that grunt will automatically pile it when I use the grunt server mand.

Does anyone know how I do this?

Edit: I've managed to add grunt sas/passs to the project, but I need to configure gruntfile.js to watch and pile the css. All I've done to add sass support is to run npm install grunt-contrib-sass --save-dev.

Share Improve this question edited Aug 24, 2013 at 22:15 ptf asked Aug 24, 2013 at 21:41 ptfptf 3,3808 gold badges39 silver badges68 bronze badges 6
  • @TJonS I've managed to add grunt sass to the project, but I need to configure gruntfile.js to watch and pile the css. – ptf Commented Aug 24, 2013 at 21:55
  • 3 Have you tried to do it at all yourself? If so, please share what you've done. – tjons Commented Aug 24, 2013 at 21:56
  • I used yeoman to set up the project, but didn't add sass/pass support. All I've done to add sass support is npm install grunt-contrib-sass --save-dev. – ptf Commented Aug 24, 2013 at 21:57
  • 2 Why don't you add the support? Or, you should at least try! – tjons Commented Aug 24, 2013 at 22:00
  • This question may be a duplicate. Here is the previous question; It may help. – tjons Commented Aug 24, 2013 at 22:02
 |  Show 1 more ment

1 Answer 1

Reset to default 6

I've made a gist of a Gruntfile.js I'm using for a project that does SASS pilation and a handfull of other things.

It's inspired of Yeoman's webapp generated Gruntfile.js, with BlessCSS and Assemble, Htmlmin configured to run smoothly with Usemin and Coffee/Mocha stuff mented out.

Basically, what you need to do is config the SASS task and then add it to the watch task, and setup livereload to watch your CSS files.


Edit:

Since I was using this Gruntfile and these grunt tasks pretty often, I've since made a yeoman generator that you can checkout here : p-j/generator-yawa

It does sass/pass among other things.

本文标签: javascriptYeoman Add sasscompass support in grunt to existing projectStack Overflow