在该目录执行: npm i npm run compile
打开此文件夹,用 VS Code 按 F5 进入“扩展开发主机”。
在命令面板(Ctrl+Shift+P):
插入完成后可输入: NAME=my-lib, DESC="Awesome utils" 模板里写 {{NAME}} / {{DESC}} 会被替换(文本类文件)。
在 vscode settings.json 中配置 presets。
{
"templateInserter.presets": [
{
"label": "Vue Lib",
"source": "https://gist.githubusercontent.com/yefengwu/aa0ee34acc68bdfca98d6aa62f05033d/raw/81b4401f648fecb4822c36373f8c4a7660328a32/initial.sh",
"dest": "."
},
{ "label": "VSCode Settings", "source": "yourname/templates/vscode-basic#main", "dest": ".vscode" }
],
"templateInserter.overwritePolicy": "ask",
"templateInserter.enableVarSubstitution": false
}