每次修改 template 或者插件脚本都需要重启才能生效,求正确的方式
MARK,解决了踢一下
1赞
正确的方式就是不要在大项目中修改,新建个hello world项目,在hello world中修改完后再copy到大项目中,hello world重启贼快
WOW,妙啊~
现在使用 Ctrl + R 重新 Load 下编辑器会刷新,比重启好那么一丢丢吧。
想到个更舒服的解决方式,require 一个 js 单独处理,处理完从 require cache 清掉,就不要任何重启或者 reload 了。
require("./run").start();
‘use strict’;
const fs = require(‘fs’);
const path = require(‘path’);
const run = {
start() {
try {
cc.log("running111.")
} catch (error) {
} finally {
this.clean();
}
},
clean() {
Object.keys(require.cache).forEach(function(key) {
if(key === __filename) {
delete require.cache[key]
}
})
}
}
module.exports = run;
1赞
该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。