import * as path from 'path'; import * as fs from 'fs-extra'; import * as babel from '@babel/core'; import * as vfs from '../fs'; import * as vms from '../ms'; import * as compiler from 'vue-template-compiler'; import * as utils from '../utils'; export * from './nuims'; export async function addLayout(fullPath: string, nodePath: string, type: string) { const vueFile = new vfs.VueFile(fullPath); await vueFile.open(); vueFile.parseTemplate(); let tplPath = path.resolve(__dirname, `../../snippets/${type}.vue`); let tpl = await fs.readFile(tplPath, 'utf8'); tpl = tpl.replace(/^