Skip to content

Commit

Permalink
feat: add build task
Browse files Browse the repository at this point in the history
  • Loading branch information
SoldierAb committed Dec 21, 2019
1 parent 5adaa6e commit 9a21115
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const gulp = require('gulp'),
filter = require('gulp-filter'),
gulpif = require('gulp-if'),
inject = require('gulp-inject'),
gulp_server = require('gulp-webserver'),
bSync = require('browser-sync'),
fs = require("fs"),
del = require('del'),
Expand All @@ -28,7 +29,6 @@ const themeTask = done => {
allTheme.forEach(item => {
scssTask(done, item)
})
console.log('theme bundle');
done()
}

Expand Down Expand Up @@ -112,11 +112,26 @@ const jsTask = (done) => {
done();
}


const webServer = ()=>{
gulp.src([output_path, './'])
.pipe(gulp_server({
open:true,
// directoryListing: true,
livereload:{
enable:true,
fallback: 'index.html'
}
}))
}

gulp.task('clean', cleanFiles)
gulp.task('watch', watchPipe)
// gulp.task('scss', scssTask)
gulp.task('scss', themeTask)
gulp.task('js', jsTask)
gulp.task('html', injectTask)
gulp.task('server', server)
gulp.task('default', gulp.series('clean', gulp.parallel('scss', 'js'), 'server', 'watch'))
gulp.task('web',webServer)
gulp.task('default', gulp.series('clean', gulp.parallel('scss', 'js'), 'watch','web'))
gulp.task('build', gulp.series('clean', gulp.parallel('scss', 'js')))
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "gulp --env=production",
"build": "gulp build --env=production",
"dev": "gulp --env=development",
"commit": "git add . && git-cz",
"push": "npm-run-all commit release",
Expand Down

0 comments on commit 9a21115

Please sign in to comment.