Fixes vendor JS
This commit is contained in:
1 parent
896794f8d5
commit
7e93de5e2d
4 files changed
+19786
-36
No files matched your search
+19772
File diff suppressed because it is too large.
Load diff
@@ -37,6 +37,15 @@ gulp.task('diststyles', function () {
|
||||
.pipe($.size());
|
||||
});
|
||||
|
||||
gulp.task('vendorscripts', function () {
|
||||
var wiredep = require('wiredep')();
|
||||
|
||||
return gulp.src(wiredep.js)
|
||||
.pipe($.concat('vendor.js'))
|
||||
.pipe(gulp.dest('dist/scripts'))
|
||||
.pipe($.size());
|
||||
});
|
||||
|
||||
gulp.task('scripts', function () {
|
||||
return gulp.src('app/scripts/**/*.js')
|
||||
.pipe($.jshint())
|
||||
@@ -82,7 +91,7 @@ gulp.task('clean', function () {
|
||||
return gulp.src(['.tmp', 'dist'], { read: false }).pipe($.clean());
|
||||
});
|
||||
|
||||
gulp.task('build', ['distscripts', 'diststyles', 'images', 'fonts', 'extras']);
|
||||
gulp.task('build', ['vendorscripts','distscripts', 'diststyles', 'images', 'fonts', 'extras']);
|
||||
|
||||
gulp.task('default', ['clean'], function () {
|
||||
gulp.start('build');
|
||||
@@ -92,30 +101,6 @@ gulp.task('serve', ['styles'], function () {
|
||||
require('opn')('http://aktiv.dev');
|
||||
});
|
||||
|
||||
// inject bower components
|
||||
gulp.task('wiredep', function () {
|
||||
var wiredep = require('wiredep').stream;
|
||||
|
||||
gulp.src('header.php')
|
||||
.pipe(wiredep({
|
||||
directory: 'app/bower_components',
|
||||
fileTypes: {
|
||||
html: {
|
||||
block: /(([ \t]*)<!--\s*bower:*(\S*)\s*-->)(\n|\r|.)*?(<!--\s*endbower\s*-->)/gi,
|
||||
detect: {
|
||||
js: /<script.*src=['"](.+)['"]>/gi,
|
||||
css: /<link.*href=['"](.+)['"]/gi
|
||||
},
|
||||
replace: { // Note: overriding the filePath here
|
||||
js: '<script src="/wp-content/themes/aktiv2014/{{filePath}}"></script>',
|
||||
css: '<link rel="stylesheet" href="{{filePath}}" />'
|
||||
}
|
||||
}
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('.'));
|
||||
});
|
||||
|
||||
gulp.task('watch', ['serve'], function () {
|
||||
var server = $.livereload();
|
||||
|
||||
@@ -133,5 +118,5 @@ gulp.task('watch', ['serve'], function () {
|
||||
gulp.watch('app/styles/**/*.scss', ['styles']);
|
||||
gulp.watch('app/scripts/**/*.js', ['scripts']);
|
||||
gulp.watch('app/images/**/*', ['images']);
|
||||
gulp.watch('bower.json', ['wiredep']);
|
||||
gulp.watch('bower.json', ['vendorscripts']);
|
||||
});
|
||||
@@ -13,15 +13,7 @@
|
||||
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,700,800,600' rel='stylesheet' type='text/css'>
|
||||
<?php wp_head(); ?>
|
||||
|
||||
<!-- bower:js -->
|
||||
<script src="/wp-content/themes/aktiv2014/app/bower_components/jquery/dist/jquery.js"></script>
|
||||
<script src="/wp-content/themes/aktiv2014/app/bower_components/modernizr/modernizr.js"></script>
|
||||
<script src="/wp-content/themes/aktiv2014/app/bower_components/fastclick/lib/fastclick.js"></script>
|
||||
<script src="/wp-content/themes/aktiv2014/app/bower_components/jquery.cookie/jquery.cookie.js"></script>
|
||||
<script src="/wp-content/themes/aktiv2014/app/bower_components/jquery-placeholder/jquery.placeholder.js"></script>
|
||||
<script src="/wp-content/themes/aktiv2014/app/bower_components/foundation/js/foundation.js"></script>
|
||||
<script src="/wp-content/themes/aktiv2014/app/bower_components/moment/moment.js"></script>
|
||||
<!-- endbower -->
|
||||
<script src="<?php bloginfo( 'stylesheet_directory' ); ?>/dist/scripts/vendor.js"></script>
|
||||
<script src="<?php bloginfo( 'stylesheet_directory' ); ?>/dist/scripts/main.js"></script>
|
||||
|
||||
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
"wiredep": "^1.4.3",
|
||||
"gulp-plumber": "~0.6.3",
|
||||
"gulp-sass": "~0.7.2",
|
||||
"gulp-util": "~2.2.19"
|
||||
"gulp-util": "~2.2.19",
|
||||
"gulp-concat": "~2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
|
||||
Reference in new issue
Block a user