我刚刚设置了一个新项目来测试libsass。
安装的地基,凉亭和咕噜声。
这个项目运行得很好,有了咕哝的表。
然后我用Chrome ->DevTools打开了这个项目。
我正在检查默认app.scss生成的css,
我所有的样式都映射到_visibility.scss,而这些样式实际上是在app.scss中

我的Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
includePaths: ['bower_components/foundation/scss'],
sourceMap: true,
debugInfo: true
},
dist: {
options: {
outputStyle: 'nested'
},
files: {
'css/app.css': 'scss/app.scss'
}
}
},
watch: {
grunt: { files: ['Gruntfile.js'] },
sass: {
files: 'scss/**/*.scss',
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('build', ['sass']);
grunt.registerTask('default', ['build','watch']);
}
我的配置有问题吗?
发布于 2015-01-29 14:47:03
这与Gruntfile的配置方式有关。在sass选项下,您有了sourceMap: true,这是将编译好的css映射回sass部分。如果您更改为sourceMap: false,那么一切都应该按照您预期的方式工作。
sass: {
options: {
includePaths: ['bower_components/foundation/scss'],
sourceMap: false,
debugInfo: true
},希望这对你有用!
发布于 2015-02-06 13:20:18
源映射和libsass、节点-sass或grunt-sass似乎存在问题,这取决于您所跟踪的线程:
https://github.com/sass/node-sass/issues/619
https://github.com/sindresorhus/grunt-sass/pull/146
您可以尝试根据以下内容对CLI工具进行回溯:
https://github.com/zurb/foundation/issues/6129
IMHO --这表明web开发CLI工具已经变得混乱,人们花在工作上的时间比实际工作的时间更多。
通常,当提出这样的问题时,确实需要指定当前运行的所有CLI工具(例如grunt、sass、lib-sass等)的哪个版本,否则不太可能有一个有用的答案。
https://stackoverflow.com/questions/28202498
复制相似问题