2015-08-16 103 views
2

我試圖使用閨房,然後一飲而盡安裝砌體砌築安裝。該depandencies和覆蓋:如何與鮑爾

"dependencies": { 
    "fontawesome": "~4.3.0", 
    "bootstrap": "~3.3.5", 
    "superfish": "~1.7.6", 
    "masonry": "~3.3.1" 
    }, 
    "overrides": { 
    "jquery": { 
     "ignore": true 
    }, 
    "masonry": { 
     "main": ["./dist/masonry.pkgd.min.js"] 
    } 
    } 

在我的控制檯我得到以下錯誤:

遺漏的類型錯誤:無法讀取屬性未定義

「項目」砌體的封裝版本包含了所有的依賴但我仍然得到這個錯誤。

在我gulpfile我有這樣的任務,以創建bower.js與所有供應商的包文件:

gulp.task('js:bower:bootstrap', function() { 
    /* 
    * Custom bootstrap javascript build 
    */ 
    var BS = SRC_FOLDER + '/bower_components/bootstrap'; 

    return gulp.src([ 
     BS + '/js/transition.js', 
     BS + '/js/alert.js', 
     BS + '/js/button.js', 
     // BS + '/js/carousel.js', 
     BS + '/js/collapse.js', 
     BS + '/js/dropdown.js', 
     BS + '/js/modal.js', 
     BS + '/js/tooltip.js', 
     BS + '/js/popover.js', 
     BS + '/js/scrollspy.js', 
     BS + '/js/tab.js', 
     BS + '/js/affix.js', 
    ]) 
    .pipe(concat('bootstrap.js')) 
    .pipe(gulp.dest(TMP_FOLER + '/bootstrap/')); 
}); 

gulp.task('js:bower', ['js:bower:bootstrap'], function() { 
    /* 
    * Build all bower javascript components 
    */ 
    return gulp.src(mainBowerFiles([ 
     '**/*.js', 
     '!**/bootstrap/**/bootstrap.js' 
    ])).pipe(addsrc([ 
     TMP_FOLER + '/bootstrap/*.js' 
    ])) 
    .pipe(concat('bower.js')) 
    .pipe(gulp.dest(DST_FOLDER + '/js/')) 
    .pipe(rename({ suffix: '.min' })) 
    .pipe(uglify()) 
    .pipe(gulp.dest(DST_FOLDER + '/js/')); 
}); 

回答

-2

你嘗試安裝砌體什麼命令?

Masonry homepage說,使用:

鮑爾:bower install masonry --save

(或具有NPM:npm install masonry-layout

另外,如果你要使用 「masonry.pkgd.min.js」那麼它需要被放置到HTML,並添加爲<script src="/path/to/the/masonry.pkgd.min.js"></script>

+0

我用的亭子安裝磚石--save.The masonr.pkgd.min.js包括在我創建使用咕嘟咕嘟的bower.js文件。 –