Skip to content

Commit

Permalink
Removed Wiredep etc because it's not needed
Browse files Browse the repository at this point in the history
You can just include the JS files in the script src instead and it'll
build it that way.
  • Loading branch information
sondr3 committed Sep 14, 2015
1 parent 8dd8f85 commit 428c827
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 55 deletions.
4 changes: 1 addition & 3 deletions generators/gulp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ module.exports = generators.Base.extend({
'gulp-sourcemaps': '^1.3.0',
'gulp-uglify': '^1.1.0',
'gulp-uncss': '^1.0.0',
'main-bower-files': '^2.8.2',
'shelljs': '^0.5.1',
'wiredep': '^3.0.0-beta'
'shelljs': '^0.5.1'
});

if (this.options.uploading === 'Amazon S3') {
Expand Down
61 changes: 14 additions & 47 deletions generators/gulp/templates/gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ import parallelize from 'concurrent-transform';
// BrowserSync is used to live-reload your website
import browserSync from 'browser-sync';
const reload = browserSync.reload;
// Wiredep is used to automatically wire up your Bower dependencies and
// main-bower-files is used to move the files to the 'assets/vendor folder
import wiredeps from 'wiredep';
const wiredep = wiredeps.stream;
import bowerFiles from 'main-bower-files';
// AutoPrefixer
import autoprefixer from 'autoprefixer-core';

Expand All @@ -34,11 +29,10 @@ import autoprefixer from 'autoprefixer-core';
* 3. Development tasks
* 4. Production and development tasks
* 5. Development tasks
* 6. Bower tasks
* 7. Deployment tasks (if any)
* 8. Various
* 9. Serve tasks
* 10. Main tasks
* 6. Deployment tasks (if any)
* 7. Various
* 8. Serve tasks
* 9. Main tasks
*
*/

Expand Down Expand Up @@ -303,43 +297,10 @@ gulp.task('html', () =>
.pipe(gulp.dest('dist'))
);

<% if (!noUpload) { %>//
// 6. Deployment tasks
//
// 6. Bower tasks
//
// Wires your Bower dependencies into their own include file that are then
// inserted into the default layout, automatically adding JS and CSS
gulp.task('bower', () => {
// Bower dependencies to exlude, for example:
// const bowerExcludes = ['jquery'];
const bowerExcludes = [];

return gulp.src('src/_includes/bower_{scripts,styles}.html')
.pipe(wiredep({
exclude: bowerExcludes,
fileTypes: {
html: {
replace: {
js: filePath => {
return '<script src="' + '/assets/vendor/' + filePath.split('/').pop() + '"></script>'; //eslint-disable-line
},
css: filePath => {
return '<link rel="stylesheet" href="' + '/assets/vendor/' + filePath.split('/').pop() + '"/>'; //eslint-disable-line
}
}
}
}
}))
.pipe(gulp.dest('src/_includes'));
});

// Copies the Bower dependencies into the '.tmp' folder so they work with
// BrowserSync
gulp.task('bower:files', () => {
return gulp.src(bowerFiles())
.pipe(gulp.dest('.tmp/assets/vendor'))
.pipe($.size({title: 'Bower assets for development'}));
});

<% } -%>
<% if (amazonS3) { -%>
// Task to deploy your site to Amazon S3 and Cloudfront
gulp.task('deploy', () => {
Expand Down Expand Up @@ -434,7 +395,7 @@ gulp.task('deploy', () => {
<% } -%>
<% if (noUpload) { -%><% } -%>
//
// 8. Various tasks
// 7. Various tasks
//
// Lint your JavaScript to look for errors and style errors
gulp.task('lint', () =>
Expand All @@ -452,6 +413,9 @@ gulp.task('lint', () =>
.pipe($.eslint.failOnError())
);

//
// 8. Serve tasks
//
// BrowserSync will serve our site on a local server for us and other devices to use
// It will also autoreload across all devices as well as keep the viewport synchronized
// between them.
Expand Down Expand Up @@ -481,6 +445,9 @@ gulp.task('serve:dist', () => {
});
});

//
// 9. Main tasks
//
// Asset tasks for development and production
gulp.task('assets:dev', gulp.series('clean:assets', 'styles:dev', 'script:dev', 'fonts', 'images'));
gulp.task('assets', gulp.series('clean:assets', 'styles', 'script', 'fonts', 'images'));
Expand Down
6 changes: 1 addition & 5 deletions test/gulp.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ describe('jekyllized:gulp', function () {
'"gulp-sourcemaps": "^1.3.0"',
'"gulp-uglify": "^1.1.0"',
'"gulp-uncss": "^1.0.0"',
'"main-bower-files": "^2.8.2"',
'"shelljs": "^0.5.1"',
'"wiredep": "^3.0.0-beta"'
'"shelljs": "^0.5.1"'
].forEach(function (pack) {
assert.fileContent('package.json', pack);
});
Expand Down Expand Up @@ -95,8 +93,6 @@ describe('jekyllized:gulp', function () {
'styles',
'script',
'html',
'bower',
'bower:files',
'lint',
'serve',
'serve:dist',
Expand Down

0 comments on commit 428c827

Please sign in to comment.