本文介紹了任何等效的 gulp 插件用于執(zhí)行“grunt bower"?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
使用 grunt
,我可以使用命令 grunt bower
(由 grunt-bower-requirejs
) 為我的本地 bower
組件自動生成 RequireJS
配置文件.
With grunt
, I could use command grunt bower
(provided by grunt-bower-requirejs
) to auto-generate RequireJS
config file for my local bower
components.
gulp
有沒有插件可以執(zhí)行類似的任務?
Is there any plugin for gulp
to perform similar task?
推薦答案
注意 bowerRequireJS 是一個異步函數(shù).因此,您需要使用回調(diào)(或同步返回 Promise)將該任務標記為異步,如下所示:
Mind that bowerRequireJS is an asynchronous function. So you would need to use a callback (or synchronously return a Promise) to mark that task as asynchronous like so:
gulp.task('bower', function(callback) {
var options = {
baseUrl: 'src',
config: 'src/app/require.config.js',
transitive: true
};
bowerRequireJS(options, function (rjsConfigFromBower) {
callback();
});
});
這篇關(guān)于任何等效的 gulp 插件用于執(zhí)行“grunt bower"?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!