Browse Source

feat: 新增工具函数用于写 JSON 文件

modood 8 years ago
parent
commit
105b914707
1 changed files with 6 additions and 0 deletions
  1. 6 0
      scripts/out.js

+ 6 - 0
scripts/out.js

@@ -0,0 +1,6 @@
+const fs = require('fs')
+const path = require('path')
+
+module.exports = function (name, data) {
+  fs.writeFileSync(path.resolve(__dirname, `../dist/${name}.json`), JSON.stringify(data))
+}