mirror of
https://github.com/Xevion/old.xevion.github.io.git
synced 2025-12-06 07:15:32 -06:00
Migrated to gulp 4
This commit is contained in:
@@ -14,6 +14,10 @@ const templatePath = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
module.exports = gulp => {
|
module.exports = gulp => {
|
||||||
|
const reloadBrowser = done => {
|
||||||
|
browserSync.reload();
|
||||||
|
done();
|
||||||
|
};
|
||||||
// run `jekyll build`
|
// run `jekyll build`
|
||||||
gulp.task('jekyll-build', done => {
|
gulp.task('jekyll-build', done => {
|
||||||
return cp.spawn(jekyll, ['build'], { stdio: 'inherit' }).on('close', done);
|
return cp.spawn(jekyll, ['build'], { stdio: 'inherit' }).on('close', done);
|
||||||
@@ -29,19 +33,20 @@ module.exports = gulp => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Rebuild Jekyll then reload the page
|
// Rebuild Jekyll then reload the page
|
||||||
gulp.task('jekyll-rebuild', ['jekyll-dev'], () => {
|
gulp.task('jekyll-rebuild', gulp.series(['jekyll-dev', reloadBrowser]));
|
||||||
browserSync.reload();
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('serve', ['jekyll-dev'], () => {
|
gulp.task(
|
||||||
browserSync.init({
|
'serve',
|
||||||
server: {
|
gulp.series('jekyll-dev', () => {
|
||||||
baseDir: '_site',
|
browserSync.init({
|
||||||
},
|
server: {
|
||||||
});
|
baseDir: '_site',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
gulp.watch(scssPath, ['sass', browserSync.reload]);
|
gulp.watch(scssPath, gulp.series(['sass', reloadBrowser]));
|
||||||
gulp.watch(jsPath, ['scripts', browserSync.reload]);
|
gulp.watch(jsPath, gulp.series(['scripts', reloadBrowser]));
|
||||||
gulp.watch(templatePath, ['jekyll-rebuild']);
|
gulp.watch(templatePath, gulp.task('jekyll-rebuild'));
|
||||||
});
|
})
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module.exports = gulp => {
|
|||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
prefix({
|
prefix({
|
||||||
browsers: ['last 2 versions'],
|
overrideBrowserslist: ['last 2 versions'],
|
||||||
cascade: false,
|
cascade: false,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ const sync = require('./build/browsersync');
|
|||||||
task(gulp);
|
task(gulp);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('build', ['sass', 'scripts', 'images', 'jekyll-build']);
|
gulp.task('build', gulp.series(['sass', 'scripts', 'images', 'jekyll-build']));
|
||||||
|
|||||||
2350
package-lock.json
generated
2350
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@@ -9,7 +9,7 @@
|
|||||||
"homepage": "https://github.com/bchiang7/bchiang7.github.io",
|
"homepage": "https://github.com/bchiang7/bchiang7.github.io",
|
||||||
"main": "gulpfile.js",
|
"main": "gulpfile.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "gulp serve",
|
"start": "gulp serve --watch",
|
||||||
"build": "gulp build"
|
"build": "gulp build"
|
||||||
},
|
},
|
||||||
"author": "Brittany Chiang",
|
"author": "Brittany Chiang",
|
||||||
@@ -17,12 +17,12 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuscout/eslint-config": "^0.2.1",
|
"@nuscout/eslint-config": "^0.2.1",
|
||||||
"browser-sync": "^2.26.7",
|
"browser-sync": "^2.26.7",
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^4.0.0",
|
||||||
"gulp-autoprefixer": "^6.1.0",
|
"gulp-autoprefixer": "^7.0.0",
|
||||||
"gulp-clean-css": "^3.10.0",
|
"gulp-clean-css": "^4.3.0",
|
||||||
"gulp-eslint": "^6.0.0",
|
"gulp-eslint": "^6.0.0",
|
||||||
"gulp-imagemin": "6.0.0",
|
"gulp-imagemin": "6.0.0",
|
||||||
"gulp-sass": "^4.0.2",
|
"gulp-sass": "^4.1.0",
|
||||||
"gulp-uglify": "3.0.2"
|
"gulp-uglify": "3.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user