Answer the question
In order to leave comments, you need to log in
How to make wiredep ignore one line?
Good day.
My gulpfile.js has three tasks.
The first task is responsible for compiling jade templates into html files, including all dependencies from the bower.json manifest file using the wiredep plugin
gulp.task('jade', function() {
gulp.src(config.path.dev.jade + '/index.jade')
.pipe(jade({
pretty: '\t'
}))
.pipe(wiredep({
ignorePath: '../'
}))
.pipe(gulp.dest('./src'))
.pipe(notify(config.message.jadeCompiled))
});
<!-- bower:js-->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/nodernizr-dev/modernizr-latest.js"></script>
<!-- endbower-->
gulp.task('cdn', function () {
return gulp.src('./src/index.html')
.pipe(googlecdn(require('./bower.json')))
.pipe(gulp.dest('./dist'))
.pipe(notify(config.message.cdnComplete))
});
<!-- bower:js-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="bower_components/nodernizr-dev/modernizr-latest.js"></script>
<!-- endbower-->
gulp.task('wiredep', function () {
return gulp.src('./dist/index.html')
.pipe(wiredep({
ignorePath: '../src/bower_components/',
exclude: 'jquery', // именно этой строчкой думал, что получится проигнорировать JQuery
fileTypes: {
html: {
replace: {
js: '<script src="js/vendor/{{filePath}}"></script>',
css: '<link rel="stylesheet" href="css/vendor/{{filePath}}" />'
}
}
}
}))
.pipe(gulp.dest('./dist'))
});
<!-- bower:js-->
<script src="js/vendor/nodernizr-dev/modernizr-latest.js"></script>
<!-- endbower-->
<!-- bower:js-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="js/vendor/nodernizr-dev/modernizr-latest.js"></script>
<!-- endbower-->
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question