Skip to content

Commit

Permalink
Merge pull request #42 from windyakin/update_npm_packages
Browse files Browse the repository at this point in the history
Update npm packages
  • Loading branch information
windyakin authored Jul 22, 2018
2 parents 09d242d + 75f0a7d commit 6e805d6
Show file tree
Hide file tree
Showing 3 changed files with 2,748 additions and 2,288 deletions.
65 changes: 32 additions & 33 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const Gulp = require('gulp');
const Plugins = require('gulp-load-plugins')();
const Fs = require('fs');
const Del = require('del');
const RunSequence = require('run-sequence');
const BrowserSync = require('browser-sync').create();

const PackageJSON = JSON.parse(Fs.readFileSync('./package.json'));
Expand All @@ -20,10 +19,6 @@ const BANNER = `/*!
*/
`;

Gulp.task('default', (resolve) => {
return RunSequence('build', resolve);
});

Gulp.task('gulp:lint', () => {
return Gulp.src(['gulpfile.js'])
.pipe(Plugins.eslint({ useEslintrc: true }))
Expand All @@ -35,10 +30,10 @@ Gulp.task('js:clean', () => {
return Del(['dist/js/**/*']);
});

Gulp.task('js:copy', ['js:clean'], () => {
Gulp.task('js:copy', Gulp.series('js:clean', () => {
return Gulp.src(['bootstrap/dist/js/**/*.js'], { cwd: 'node_modules' })
.pipe(Gulp.dest('dist/js'));
});
}));

Gulp.task('css:clean', () => {
return Del(['dist/css/**/*']);
Expand Down Expand Up @@ -159,44 +154,48 @@ Gulp.task('docs:serve', () => {
});

Gulp.task('watch', () => {
const message = (ev) => {
console.log(`File: ${ev.path} was ${ev.type}, running tasks...`);
const message = (filePath) => {
console.log(`File: ${filePath} was changed, running tasks...`);
};
Gulp.watch(['scss/**/*'], () => { RunSequence('css', 'docs:copy'); })
Gulp.watch(['scss/**/*'], Gulp.series('css', 'docs:copy'))
.on('change', message);
Gulp.watch(['docs/**/*.html'])
.on('change', message)
.on('change', BrowserSync.reload);
Gulp.watch(['docs/assets/scss/**/*.scss'], ['docs:css'])
Gulp.watch(['docs/assets/scss/**/*.scss'], Gulp.series('docs:css'))
.on('change', message);
});

Gulp.task('docs', (resolve) => {
return RunSequence('docs:clean', 'docs:copy', 'docs:css', resolve);
});
Gulp.task('docs', Gulp.series(
'docs:clean', 'docs:copy', 'docs:css',
));

Gulp.task('serve', ['docs:serve', 'watch']);
Gulp.task('serve', Gulp.series(
'docs:serve', 'watch',
));

Gulp.task('clean', (resolve) => {
return RunSequence(['css:clean', 'js:clean'], resolve);
});
Gulp.task('clean', Gulp.series(
'css:clean', 'js:clean',
));

Gulp.task('css', (resolve) => {
return RunSequence('css:build', 'css:minify', 'css:banner', resolve);
});
Gulp.task('css', Gulp.series(
'css:build', 'css:minify', 'css:banner',
));

Gulp.task('js', (resolve) => {
return RunSequence('js:copy', resolve);
});
Gulp.task('js', Gulp.series(
'js:copy',
));

Gulp.task('test', (resolve) => {
return RunSequence('css:lint', 'gulp:lint', resolve);
});
Gulp.task('test', Gulp.series(
'css:lint', 'gulp:lint',
));

Gulp.task('build', (resolve) => {
return RunSequence('clean', ['css', 'js'], ['docs'], resolve);
});
Gulp.task('build', Gulp.series(
'clean', Gulp.parallel('css', 'js'), 'docs',
));

Gulp.task('release', (resolve) => {
return RunSequence('build', 'packing', resolve);
});
Gulp.task('release', Gulp.series(
'build', 'packing',
));

Gulp.task('default', Gulp.parallel('build'));
Loading

0 comments on commit 6e805d6

Please sign in to comment.