From bb95d6e481b5e18ef0bd5dc6ba34645b4d4d472c Mon Sep 17 00:00:00 2001 From: Irvin Date: Fri, 5 Oct 2018 14:29:28 +0800 Subject: [PATCH 1/6] trying update babel to fix npm start issue --- .babelrc | 2 +- package.json | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.babelrc b/.babelrc index c13c5f6..1320b9a 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["es2015"] + "presets": ["@babel/preset-env"] } diff --git a/package.json b/package.json index 736bdea..246cfa7 100644 --- a/package.json +++ b/package.json @@ -17,17 +17,19 @@ }, "dependencies": {}, "devDependencies": { - "babel-core": "^6.7.2", - "babel-preset-es2015": "^6.6.0", + "@babel/core": "^7.1.2", + "@babel/preset-env": "^7.1.0", + "@babel/register": "^7.0.0", "compass-mixins": "^0.12.7", "connect-livereload": "^0.5.4", "express": "^4.13.4", - "gulp": "^3.9.0", + "gulp": "^3.9.1", + "gulp-babel": "^8.0.0", "gulp-jade": "^1.1.0", "gulp-plumber": "^1.1.0", "gulp-refresh": "^1.1.0", "gulp-sass": "^2.2.0", - "gulp-util": "^3.0.7" + "gulp-util": "^3.0.8" }, "repository": [ { From da65edc7bda60c803e805e28393a3483a078d21a Mon Sep 17 00:00:00 2001 From: Irvin Date: Fri, 5 Oct 2018 17:48:55 +0800 Subject: [PATCH 2/6] deploy.sh: just use index.html from _public to deply instead of rebuild index/404.jade --- deploy.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deploy.sh b/deploy.sh index 17a3bdc..25eb286 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,8 +1,9 @@ git checkout gh-pages git merge master -jade views/{index,404}.jade -o . -pretty +gulp build +rm index.html +rm 404.html +cp _public/*.html ./ git add . git commit -m 'deploy' -git pull -git push -git checkout master +echo "I'll no longer pull and push for you, please push with causion on which remote you'd like to." From 6f06a0940ee75d7a4f27ea081e6417f3cbcbf176 Mon Sep 17 00:00:00 2001 From: Irvin Date: Sat, 6 Oct 2018 12:35:10 +0800 Subject: [PATCH 3/6] try use gulp to do source inline instead of using jade test --- deploy.sh | 8 +++----- gulpfile.babel.js | 25 +++++++++++++++++++++++++ package.json | 6 +++++- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/deploy.sh b/deploy.sh index 25eb286..4d2fdd4 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,9 +1,7 @@ git checkout gh-pages git merge master -gulp build -rm index.html -rm 404.html -cp _public/*.html ./ -git add . +gulp deploy +git add index.html +git add 404.html git commit -m 'deploy' echo "I'll no longer pull and push for you, please push with causion on which remote you'd like to." diff --git a/gulpfile.babel.js b/gulpfile.babel.js index cd947bb..3dc28a9 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -7,6 +7,9 @@ import path from 'path'; import sass from 'gulp-sass'; import jade from 'gulp-jade'; import plumber from 'gulp-plumber'; +import inlinesource from 'gulp-inline-source'; +import debug from 'gulp-debug-streams'; +import replace from 'gulp-replace'; const app = express(); @@ -57,6 +60,28 @@ gulp.task('watch', () => { gulp.watch('js/*js', ['js']); }); +gulp.task('inlinesource', function () { + return gulp.src(`${build_path}/index.html`) + // .pipe(debug()) + // .pipe(debug(path.resolve(`${build_path}`))) + .pipe(replace(/')) + /* // uncommand to inline all scripts / css + .pipe(replace(/')) /* // uncommand to inline all scripts / css @@ -77,7 +77,7 @@ gulp.task('inlinesource', function () { compress: false, rootpath: path.resolve(`${build_path}`) })) - .pipe(gulp.dest(`${build_path}/out`)); + .pipe(gulp.dest(`${deploy_path}`)); }); gulp.task('build', ['jade', 'sass', 'js', 'assets']); From 8bfdafc48a9649f6e6f20a3d3e4d90fdad3ab80f Mon Sep 17 00:00:00 2001 From: Irvin Date: Sat, 6 Oct 2018 16:50:47 +0800 Subject: [PATCH 5/6] package / gulp: remove debug script, fix package.json error --- gulpfile.babel.js | 6 ------ package.json | 13 ++++--------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index a8e080b..fae9959 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -8,7 +8,6 @@ import sass from 'gulp-sass'; import jade from 'gulp-jade'; import plumber from 'gulp-plumber'; import inlinesource from 'gulp-inline-source'; -import debug from 'gulp-debug-streams'; import replace from 'gulp-replace'; const app = express(); @@ -63,16 +62,11 @@ gulp.task('watch', () => { gulp.task('inlinesource', function () { return gulp.src([`${build_path}/index.html`, `${build_path}/404.html`]) - // .pipe(debug(path.resolve(`${build_path}`))) .pipe(replace(/')) /* // uncommand to inline all scripts / css .pipe(replace(/