xiongzhu 2 жил өмнө
parent
commit
249ebf4096
3 өөрчлөгдсөн 10 нэмэгдсэн , 4 устгасан
  1. 2 0
      afterBuild.js
  2. 1 1
      package.json
  3. 7 3
      testupload.ts

+ 2 - 0
afterBuild.js

@@ -0,0 +1,2 @@
+const fs = require('fs')
+fs.copyFileSync('.env.production', 'dist/.env')

+ 1 - 1
package.json

@@ -6,7 +6,7 @@
   "license": "MIT",
   "scripts": {
     "prebuild": "rimraf dist",
-    "build": "nest build",
+    "build": "nest build && node afterBuild.js",
     "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
     "start": "nest start",
     "start:dev": "nest start --watch",

+ 7 - 3
testupload.ts

@@ -41,6 +41,10 @@ async function uploadDoc(title, content) {
     return `https://nebuai.oss-cn-hangzhou.aliyuncs.com/${key}`
 }
 
-uploadDoc('test', '# test').then((res) => {
-    console.log(res)
-})
+// uploadDoc('test', '# test').then((res) => {
+//     console.log(res)
+// })
+
+let paper = new WritableStreamBuffer()
+paper.write('test')
+console.log(paper.getContentsAsString('utf8'))