問題描述
我正在開發一個使用 AngularJS、D3、Pixi.js 和 gulp 作為構建系統的 Web 應用程序.除了 gulp-sass
之外,這一切都很好.以下是相關代碼:
I have a web app I'm developing using AngularJS, D3, Pixi.js, and gulp as a build system. It all works great together, except gulp-sass
. Here's the relevant code:
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
只是一個具有預定義全局變量的變量.如果我做第三行
cfg
is just a variable that has predefined globs. If I make the third line
.pipe( sass({ errLogToConsole: true, sourceComments: 'map' }))
通過添加源的映射(對調試有用),我得到以下致命錯誤.
by adding the mapping of the source (useful for debugging), I get the following 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.
On my colleague's computer, it works perfectly with or without mapping. On mine, it fails every time with the source comments mapped, and works perfectly without mapping. Both computers are iMacs running the latest version of node
(npm
), bower
, and OS X
.
知道是什么原因造成的嗎?gulp
或 gulp-sass
本身的問題?
Any idea what could be causing this? Issue in gulp
or gulp-sass
itself?
推薦答案
這些選項對我有用.
{ errLogToConsole: true, sourceComments: 'map', sourceMap: 'sass' }.
似乎總是有一些奇怪的事情發生.
There's always seems to be something weird going on.
這篇關于帶有 sourceComments 的 Gulp 中的 SASS 任務:'map' 產生 'Assertion failed'的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!