当前位置:网站首页>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);
边栏推荐
猜你喜欢
随机推荐
Remembering my first CCF-A conference paper | After six rejections, my paper is finally accepted, yay!
2020,Laya最新中高级面试灵魂32问,你都知道吗?
入门文档10 资源映射
【Day1】(超详细步骤)构建软RAID磁盘阵列
(C语言)动态内存管理
什么是阿里云·速成美站?
成功的独立开发者应对失败&冒名顶替综
LeetCode刷题之第33题
每日一题-合并两个有序链表-0720
Lua,ILRuntime, HybridCLR(wolong)/huatuo热更对比分析
一个小时教你如何掌握ts基础
Spark源码-任务提交流程之-6.2-sparkContext初始化-TaskScheduler任务调度器
每日一题-盛最多水的容器-0716
spark算子-textFile算子
新一代解析技术——云解析
[Paper Intensive Reading] Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation (R-CNN)
调用TensorFlow Objection Detection API进行目标检测并将检测结果保存至本地
添加新硬盘为什么扫描不上?如何解决?
栈区中越界可能造成的死循环可能
入门文档05-2 使用return指示当前任务已完成








