用grunt-sass编译基础sass文件
问题描述:
我已经用bower安装了基础5。通过compass watch
有编制的基础文件没有问题,但是当我想用咕噜 - 萨斯插件,我看到这个错误:用grunt-sass编译基础sass文件
Running "sass:development" (sass) task
Warning: C:\wamp\www\nik\myapp/scss/app.scss:2: error: file to import not found or unreadable: "foundation"
Use --force to continue.
Aborted due to warnings.
线app.scss的2 @import "foundation"
。 咕噜 - 萨斯在我Gruntfile.js:
sass: {
development: {
options: {
outputStyle: 'nested'
},
files: {
'.css/development/style.css': ['scss/app.scss', 'scss/style.scss']
}
},
production: {
options: {
outputStyle: 'compressed'
},
files: {
'.css/development/style.css': ['scss/app.scss', 'scss/style.scss']
}
}
我还测试this solution但无感情。
答
只是添加--libsass
在命令行安装基础,将导致安装基础是与咕噜兼容:
grunt-sass
)
随后:
sass: {
development: {
options: {
outputStyle: 'nested',
// Adding foundation source files, so we can @import them.
includePaths: ['bower_components/foundation/scss']
},
files: {
'css/style.css': ['path/to/styles/app.scss']
}
}
}
提示:您可以在app.scss最后一行中导入自己的style.scss。
问题解决。当我们使用grunt编译基础scss文件时,我们应该使用--libsass来安装基础。 'foundation new project_name --libsass' –
你可以添加更多的细节(也可以作为问题的答案?) – streetlight
已添加@streetlight答案。 –