Files
PrivateProject/王凯私活/TsxVueClassApi/gulpfile.js
2024-09-27 01:28:38 +08:00

30 lines
726 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Copyright (c) 2024. bmy
* Email2271608011@qq.com
* Githubhttps://github.com/helpcode
*/
const gulp = require('gulp');
const {exec} = require('child_process');
/**
* 执行 vue-cli-service route 命令进行路由编译
*/
gulp.task('AutoCompileRouter', function (cb) {
return exec('npm run route', (err, stdout, stderr) => {
if (err) {
console.log("编译失败: ", err);
cb(err)
} else {
console.log("编译成功");
}
});
});
/**
* 监听 page 所有文件的修改,自动触发 AutoCompileRouter 任务
*/
gulp.task('auto', async () => {
gulp.watch('src/application/page/**/*', gulp.parallel('AutoCompileRouter'));
});
gulp.task('default', gulp.parallel('auto'));