Commit 780d4cd4 authored by 贾慧斌's avatar 贾慧斌

feat: 更新转换脚本

parent 13e66719
...@@ -239,26 +239,41 @@ const traverseDirectory = async (dir, mapping, options) => { ...@@ -239,26 +239,41 @@ const traverseDirectory = async (dir, mapping, options) => {
// 复制 source 下所有文件到 temp // 复制 source 下所有文件到 temp
// await copyDir(`${sourcePath}`, `${tempPath}`); // await copyDir(`${sourcePath}`, `${tempPath}`);
await copyDir(`${sourcePath}/views/home/`, `${tempPath}/pages/home`); // 首页 S
await copyDir(`${sourcePath}/components/`, `${tempPath}/components`); // await copyDir(`${sourcePath}/views/home/`, `${tempPath}/pages/home`);
await copyDir(`${sourcePath}/style/`, `${tempPath}/style`); // await copyDir(`${sourcePath}/views/orders/`, `${tempPath}/pages/orders`);
await copyDir(`${sourcePath}/assets/`, `${tempPath}/static`); // await copyDir(`${sourcePath}/views/product/`, `${tempPath}/pages/product`);
await copyDir(`${sourcePath}/filters/`, `${tempPath}/filters`); // await copyDir(`${sourcePath}/components/`, `${tempPath}/components`);
await copyDir(`${sourcePath}/mixins/`, `${tempPath}/mixins`); // await copyDir(`${sourcePath}/style/`, `${tempPath}/style`);
// await copyDir(`${sourcePath}/assets/`, `${tempPath}/static`);
// await copyDir(`${sourcePath}/filters/`, `${tempPath}/filters`);
// await copyDir(`${sourcePath}/mixins/`, `${tempPath}/mixins`);
// await copyDir(`${sourcePath}/service/`, `${tempPath}/service`);
// await copyDir(`${sourcePath}/constants/`, `${tempPath}/constants`);
// await copyDir(`${sourcePath}/store/`, `${tempPath}/store`);
// await copyDir(`${sourcePath}/api/`, `${tempPath}/api`);
// await copyDir(`${sourcePath}/customize/`, `${tempPath}/customize`);
// 首页 E
await copyDir(`${sourcePath}/views/address/`, `${tempPath}/pages/address`);
await copyDir(`${sourcePath}/api/`, `${tempPath}/api`);
await copyDir(`${sourcePath}/service/`, `${tempPath}/service`); await copyDir(`${sourcePath}/service/`, `${tempPath}/service`);
await copyDir(`${sourcePath}/constants/`, `${tempPath}/constants`);
// 标签操作 // 标签操作
const mapping = { const mapping = {
"<div": "<view", "<div": "<view",
"</div": "</view", "</div": "</view",
"<ul": "<view",
"</ul": "</view",
"<li": "<view",
"</li>": "</view>",
"@/assets/": "@/static/", "@/assets/": "@/static/",
"@/views/": "@/pages/", "@/views/": "@/pages/",
"<img": "<image" "<img": "<image"
}; };
const options = { const options = {
extensions: [".vue"] extensions: [".vue", ".js"]
}; };
await traverseDirectory(tempPath, mapping, options); await traverseDirectory(tempPath, mapping, options);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment