gpt4 book ai didi

javascript - Gulp 无法定位@导入文件 nib.style

转载 作者:行者123 更新时间:2023-11-30 09:55:28 26 4
gpt4 key购买 nike

出现以下错误

 failed to locate@import file nib.style

尝试使用 gulp 编译 .styl 文件时

知道如何解决吗?

gulp.task('flat', function () {
gulp.src(['**/*.styl', '!**/**mixins**.styl', '!**/**variables**.styl'])
.pipe(stylus())
.pipe(gulp.dest('test/'));
});


{
"dependencies": {
"bower": "~1.4.1",
"gulp": "~3.9.0",
"gulp-complexity": "~0.3.0",
"gulp-connect": "~2.2.0",
"gulp-jscs": "~2.0.0",
"gulp-jscs-stylish": "~1.1.2",
"gulp-jshint": "~1.11.2",
"gulp-sloc": "~1.0.4",
"gulp-util": "~3.0.6",
"gulp-stylus": "~2.1.1",
"jshint-stylish": "~2.0.1",
"open": "~0.0.5",
"stylus": "~0.52.4",
"nib": "~1.1.0"
},
"name": "app",
"private": true,
"version": "0.0.0"
}

最佳答案

你必须在你的任务中导入 nib:

var nib = require( 'nib' );

你还需要告诉手写笔使用它:

gulp.src( [ '**/*.styl', '!**/**mixins**.styl', '!**/**variables**.styl' ] )
.pipe( stylus( { use: [ nib() ] } ) )
.pipe( gulp.dest( 'test/' ) );
});

关于javascript - Gulp 无法定位@导入文件 nib.style,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34268166/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com