可以使用用fs鸭,data是需要储存的内容
const projectPath = window.cce.project as string; //当前项目文件路径
projectPath.replace("\\", " / ");
const filePath = `${projectPath}/` + SCENE_PATH;
const fs: any = require('fs');
const write = () => {
fs.writeFile(filePath + this.sceneName + this.sceneIDSave + typename, data, (err: Error) => {
if (err) {
console.warn("生产配置失败" + ':' + filePath + this.sceneName + this.sceneIDSave);
console.error("error", err);
} else {
console.warn("生产配置成功" + ':' + filePath + this.sceneName + this.sceneIDSave);
}
this._isFinish = true;
});
}
fs.exists(filePath, function (e: boolean) {
if (!e) {
fs.mkdir(filePath, function (err: Error) {
if (err) {
} else {
write();
}
});
} else {
write();
}
});