Uygulamamdaki cower'dan css ve js dosyalarını eklemek için wiredep'u kullanmaya çalışıyorum.Wiredep kullanarak doğru bağımlılık enjeksiyon yolu nasıl alınır?
app
├── bower_components
│ ├── lib1
│ │ ├── lib1.css
│ │ ├── lib1.js
│ │ ├── bower.json
│ │ ├── package.json
│ │ └── README.md
│ ├── lib2
│ │ ├── lib2.css
│ │ ├── lib2.js
│ │ ├── bower.json
│ │ ├── package.json
│ │ └── README.md
│ │ ├── globals.js
│ │ ├── locale-header.js
│ │ └── test-header.js
├── index.html
└── rawHtml
└── index.html
Ben app/rawHtml/index.html
app/index.html
için kullanmak istiyorum: altındaki klasör ağacında gösterilen ben app/rawHtml/index.html
ham index.html
(html exculding kameriye css ve js) var.
gulpfile.js
gulp.task('bower:dev', function() {
return gulp.src('app/rawHtml/index.html')
.pipe(wiredep())
.pipe(gulp.dest('app/'));
});
Şimdi index.html dosyası oluşturulur şu şekildedir: wiredep
Benim gulpfile olduğunu. şöyle Ama bağımlılıkları app/rawHtml/index.html
göre, enjekte edilir: Bunun yerine hedef dosyaya app/index.html
göre bir
<!-- bower:css -->
<link rel="stylesheet" href="../bower_components/lib1/lib1.css" />
<link rel="stylesheet" href="../bower_components/lib2/lib2.css" />
<!-- bower:js -->
<script src="../bower_components/lib1/lib1.js"></script>
<script src="../bower_components/lib2/lib2.js"></script>
şöyle:
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/lib1/lib1.css" />
<link rel="stylesheet" href="bower_components/lib2/lib2.css" />
<!-- bower:js -->
<script src="bower_components/lib1/lib1.js"></script>
<script src="bower_components/lib2/lib2.js"></script>
ben kaynak ve hedef index.html
tutmaya yapmaya çalıştık aynı dizini, ancak hedef dosyayı yeniden adlandırma seçeneğini bulamadım. Doğru enjeksiyon yolunu alabilmem için nasıl kablolu kullanırım?