Skip to content

Commit

Permalink
fix: sync static
Browse files Browse the repository at this point in the history
  • Loading branch information
Weihua Lu authored and tiensonqin committed Sep 28, 2021
1 parent 1370fb4 commit 4d59cb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 12 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const del = require('del')

const outputPath = path.join(__dirname, 'static')
const resourcesPath = path.join(__dirname, 'resources')
const publicStaticPath = path.join(__dirname, 'public/static')
const sourcePath = path.join(__dirname, 'src/main/frontend')
const resourceFilePath = path.join(resourcesPath, '**')
const outputFilePath = path.join(outputPath, '**')

const css = {
watchCSS () {
Expand Down Expand Up @@ -45,6 +47,15 @@ const common = {

keepSyncResourceFile () {
return gulp.watch(resourceFilePath, { ignoreInitial: true }, common.syncResourceFile)
},


syncStatic() {
return gulp.src(outputFilePath).pipe(gulp.dest(publicStaticPath))
},

keeypSyncStatic() {
return gulp.watch(outputFilePath, { ignoreInitial: true }, common.syncStatic)
}
}

Expand Down Expand Up @@ -98,5 +109,5 @@ exports.electronMaker = async () => {
}

exports.clean = common.clean
exports.watch = gulp.series(common.syncResourceFile, gulp.parallel(common.keepSyncResourceFile, css.watchCSS))
exports.watch = gulp.series(common.syncResourceFile, common.syncStatic, gulp.parallel(common.keepSyncResourceFile, css.watchCSS, common.keeypSyncStatic))
exports.build = gulp.series(common.clean, common.syncResourceFile, css.buildCSS)
1 change: 0 additions & 1 deletion public/static

This file was deleted.

0 comments on commit 4d59cb9

Please sign in to comment.