Commit 47cf87e9 authored by hewenhao's avatar hewenhao

feat: export

parent db76c8b7
......@@ -28,7 +28,7 @@ const list = folderList
.map(item => {
const subFolderPath = `./${f}/${item}`
const subList = fastglob.sync(`**`, { onlyFiles: true, deep: 1, cwd: subFolderPath })
const outputFileName = `./dist/${f}_${item}.json`;
const outputFileName = `./dist/${f}_${item}.js`;
return {
folderPath: subFolderPath,
outputFileName,
......@@ -62,7 +62,7 @@ function uploadFolder (folder) {
},
...ret
}), {});
fs.writeFileSync(folder.outputFileName, JSON.stringify(mapper, null, 2));
fs.writeFileSync(folder.outputFileName, `export default ${JSON.stringify(mapper, null, 2)}`);
return mapper;
})
}
......
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