我有一个正在使用 AngularJS、D3、Pixi.js 和 gulp 作为构建系统开发的网络应用程序。除了 gulp-sass
之外,它们都可以很好地协同工作。这是相关代码:
gulp.task('sass-dev', ['clean-dev'], function() {
return gulp.src( cfg.appFiles.rootSass )
.pipe( sass({ errLogToConsole: true }))
.pipe( gulp.dest( cfg.buildDir+cfg.destDirs.css ) )
.pipe( livereload( server ) );
});
cfg
只是一个具有预定义 glob 的变量。如果我做第三行
.pipe( sass({ errLogToConsole: true, sourceComments: 'map' }))
通过添加源映射(对调试有用),我得到以下 fatal error 。
Assertion failed: (val->IsString()), function _NanGetExternalParts, file ../node_modules/nan/nan.h, line 1725.
Abort trap: 6
在我同事的电脑上,无论有没有映射,它都能完美运行。在我的身上,它每次都在映射源评论时失败,并且在没有映射的情况下也能完美运行。两台计算机都是运行最新版本 node
(npm
)、bower
和 OS X
的 iMac。
知道是什么原因造成的吗? gulp
或 gulp-sass
本身的问题?
最佳答案
这些选项对我有用。
{ errLogToConsole: true, sourceComments: 'map', sourceMap: 'sass' }.
似乎总是有一些奇怪的事情发生。
关于javascript - 带有 sourceComments : 'map' produces 'Assertion failed' 的 gulp 中的 SASS 任务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24397561/