admin管理员组文章数量:1025208
I'm building a sizable JS application using angularjs, and I'm using Grunt to process everything into a pact distribution. I can't figure out what to use to pile, concat and minify my .scss files into one single css file.
My project is organized by modules, so the .scss files are scattered, rather than grouped in a single directory.
I've looked at grunt-contrib-sass and grunt-contrib-pass, but they both seem to require you to individually specify files to pile. I'm looking for a solution that won't have to change when I add source files.
What Grunt plugin can I use to pile, concat and minify my sass files into a single css file?
I'm currently using concat and recess to concat and minify my plain css files:
concat: {
css: {
src: ['<%= src.css %>'],
dest: '<%= distdir %>/<%= pkg.name %>.css'
},
},
recess: {
min: {
files: {
'<%= distdir %>/<%= pkg.name %>.css': ['<%= distdir %>/<%= pkg.name %>.css']
},
options: {
press: true
}
}
}
I'm building a sizable JS application using angularjs, and I'm using Grunt to process everything into a pact distribution. I can't figure out what to use to pile, concat and minify my .scss files into one single css file.
My project is organized by modules, so the .scss files are scattered, rather than grouped in a single directory.
I've looked at grunt-contrib-sass and grunt-contrib-pass, but they both seem to require you to individually specify files to pile. I'm looking for a solution that won't have to change when I add source files.
What Grunt plugin can I use to pile, concat and minify my sass files into a single css file?
I'm currently using concat and recess to concat and minify my plain css files:
concat: {
css: {
src: ['<%= src.css %>'],
dest: '<%= distdir %>/<%= pkg.name %>.css'
},
},
recess: {
min: {
files: {
'<%= distdir %>/<%= pkg.name %>.css': ['<%= distdir %>/<%= pkg.name %>.css']
},
options: {
press: true
}
}
}
Share
Improve this question
asked Jan 16, 2014 at 6:34
ChasephChaseph
1,9133 gold badges16 silver badges20 bronze badges
3
-
You should be able to do it with
recess
by adding paths to thefiles
array – megawac Commented Jan 16, 2014 at 6:39 - grunt-recess claims to be for css and less: Lint and minify CSS and LESS. Does it work with sass too? – Chaseph Commented Jan 16, 2014 at 6:42
- grunt-sass or grunt-contrib-sass depending upon your needs (grunt-sass uses lib-sass). – steveax Commented Jan 16, 2014 at 7:20
1 Answer
Reset to default 3I think a documentation about patterns can help you.
http://gruntjs./configuring-tasks#globbing-patterns
sass: { // Task
dist: { // Target
options: { // Target options
style: 'expanded'
},
src: 'foo/{a,b}*.sass', // you can use some kind of regular expression
dest: 'foo/css/
}
}
I'm building a sizable JS application using angularjs, and I'm using Grunt to process everything into a pact distribution. I can't figure out what to use to pile, concat and minify my .scss files into one single css file.
My project is organized by modules, so the .scss files are scattered, rather than grouped in a single directory.
I've looked at grunt-contrib-sass and grunt-contrib-pass, but they both seem to require you to individually specify files to pile. I'm looking for a solution that won't have to change when I add source files.
What Grunt plugin can I use to pile, concat and minify my sass files into a single css file?
I'm currently using concat and recess to concat and minify my plain css files:
concat: {
css: {
src: ['<%= src.css %>'],
dest: '<%= distdir %>/<%= pkg.name %>.css'
},
},
recess: {
min: {
files: {
'<%= distdir %>/<%= pkg.name %>.css': ['<%= distdir %>/<%= pkg.name %>.css']
},
options: {
press: true
}
}
}
I'm building a sizable JS application using angularjs, and I'm using Grunt to process everything into a pact distribution. I can't figure out what to use to pile, concat and minify my .scss files into one single css file.
My project is organized by modules, so the .scss files are scattered, rather than grouped in a single directory.
I've looked at grunt-contrib-sass and grunt-contrib-pass, but they both seem to require you to individually specify files to pile. I'm looking for a solution that won't have to change when I add source files.
What Grunt plugin can I use to pile, concat and minify my sass files into a single css file?
I'm currently using concat and recess to concat and minify my plain css files:
concat: {
css: {
src: ['<%= src.css %>'],
dest: '<%= distdir %>/<%= pkg.name %>.css'
},
},
recess: {
min: {
files: {
'<%= distdir %>/<%= pkg.name %>.css': ['<%= distdir %>/<%= pkg.name %>.css']
},
options: {
press: true
}
}
}
Share
Improve this question
asked Jan 16, 2014 at 6:34
ChasephChaseph
1,9133 gold badges16 silver badges20 bronze badges
3
-
You should be able to do it with
recess
by adding paths to thefiles
array – megawac Commented Jan 16, 2014 at 6:39 - grunt-recess claims to be for css and less: Lint and minify CSS and LESS. Does it work with sass too? – Chaseph Commented Jan 16, 2014 at 6:42
- grunt-sass or grunt-contrib-sass depending upon your needs (grunt-sass uses lib-sass). – steveax Commented Jan 16, 2014 at 7:20
1 Answer
Reset to default 3I think a documentation about patterns can help you.
http://gruntjs./configuring-tasks#globbing-patterns
sass: { // Task
dist: { // Target
options: { // Target options
style: 'expanded'
},
src: 'foo/{a,b}*.sass', // you can use some kind of regular expression
dest: 'foo/css/
}
}
本文标签: javascriptCompileConcatenate and Minify Sass files with GruntStack Overflow
版权声明:本文标题:javascript - Compile, Concatenate and Minify Sass files with Grunt - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745618069a2159408.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论