当前位置:网站首页>Getting Started Documentation 12 webserve + Hot Updates
Getting Started Documentation 12 webserve + Hot Updates
2022-08-05 06:08:00 【dongsdh】
Starting the project only executes the serve task once
Do not execute serve after modifying the content, otherwise there will be a prompt
const { src, dest, series, watch, parallel } = require("gulp");const del = require("del");const webserver = require("gulp-webserver");function clean(cb) {console.log('cleanup');return del("./dist/"); //Delete the specified directory and prepare for the dump filecb()}function js(cb) {console.log('processing js');src("./src/js/*.js").pipe(dest("./dist/js"));cb();}function html(cb) {console.log('processing html');src("./src/html/*.html").pipe(dest("./dist/html"));cb();}function serve() {src("./").pipe(webserver({host: "localhost",port: 366,livereload: true, // live reloadopen: "dist/html/my.html", // file opened by default browser at startupdirectoryListing: {enable: true,path: "./dist/html",}}));}const Run = series(clean,parallel(js,html))watch(['./src/'], Run);exports.default = series(Run,serve);
边栏推荐
猜你喜欢
随机推荐
【3D模型教程】ZBrush如何表现皮肤纹理?
Spark源码-任务提交流程之-6.2-sparkContext初始化-TaskScheduler任务调度器
函数在开发环境中的应用(简易实例)
你要找的cocos面试答案都在这里了!
D41_缓冲池
入门文档09 独立的watch
D39_坐标转换
C语言程序死循环问题解析——变量被修改
来来来,一文让你读懂Cocos Creator如何读写JSON文件
I217-V在openwrt软路由下大流量断网问题
【Day1】VMware软件安装
(oj)原地移除数组中所有的元素val、删除排序数组中的重复项、合并两个有序数组
每日一题-正则表达式匹配-0715
(C语言)strlen、strcpy、strcat、strcmp、strstr函数的模拟实现
PVE 直通硬盘到TrueNAS
栈的应用——力扣 20.有效的括号
【UiPath2022+C#】UiPath 练习-数据操作
D46_给刚体施加的力
Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
什么?CDN缓存加速只适用于加速静态内容?