当前位置:网站首页>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);
边栏推荐
猜你喜欢
随机推荐
每日一题-盛最多水的容器-0716
huatuo 革命性热更新解决方案系列1·1 为什么这么NB?huatuo革命Unity热更新
UE4动画雨滴材质制作教程
硬盘分区和永久挂载
什么?CDN缓存加速只适用于加速静态内容?
每日一题-最长回文子串-0714
“元宇宙”是个啥?都有哪些大招?
Unity huatuo 革命性热更系列1.2 huatuo热更环境安装与示例项目
每日一题-合并两个有序链表-0720
IJCAI 2022|Boundary-Guided Camouflage Object Detection Model BGNet
【Day1】VMware软件安装
Unity3D中的ref、out、Params三种参数的使用
D39_欧拉角与四元数
LeetCode刷题之第33题
偷题——腾讯游戏开发面试问题及解答
D41_缓冲池
入门文档06 向流(stream)中添加文件
每日一题-二分法
spark算子-repartition算子
添加新硬盘为什么扫描不上?如何解决?