我正在使用grunt指南针,我只想编译单个scss文件src/scss/image_slider.scss
而不是scss文件夹下的所有文件。
下面编写的代码适用于完整的scss foler。
compass: {
dist: {
options: {
sassDir: 'src/scss',
cssDir: 'src/css',
}
}
},
答案 0 :(得分:0)
grunt-contrib-compass
https://github.com/gruntjs/grunt-contrib-compass#specify中有一个选项:
specify
Type: String|Array
Lets you specify which files you want to compile.
Useful if you don't want to compile the whole folder.
Globbing supported. Ignores filenames starting with underscore.
Paths are relative to the Gruntfile.
所以你应该能够:
compass: {
dist: {
options: {
sassDir: 'src/scss',
cssDir: 'src/css',
specify: 'myfile.scss'
}
}
},
答案 1 :(得分:0)
它采用以下格式:
compass: {
dist: {
options: {
sassDir: 'src/scss',
specify: 'src/scss/my_file.scss',
cssDir: 'src/css',
}
}
},