From f98002846a01a43de893008013091dedebcf829f Mon Sep 17 00:00:00 2001 From: wss-git Date: Sat, 9 Oct 2021 16:51:07 +0800 Subject: [PATCH] fix: not found static --- package.json | 4 ++-- src/script/build.sh | 10 +--------- tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index a4e9462..6254afb 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,8 @@ "lint": "f2elint scan", "fix": "f2elint fix", "typecheck": "npx tsc -p tsconfig.json --noEmit", - "prebuild": "npm i rimraf --no-save && rimraf package-lock.json && rimraf dist && rimraf node_modules && npm i && ./src/script/build.sh", - "build": "npm run fix && npm run lint && ncc build src/index.ts -m -e @serverless-devs/core -o dist" + "prebuild": "npm i rimraf --no-save && rimraf package-lock.json && rimraf dist && rimraf node_modules && npm i && npm run fix && npm run lint", + "build": "./src/script/build.sh && ncc build src/index.ts -m -e @serverless-devs/core -o dist" }, "husky": { "hooks": { diff --git a/src/script/build.sh b/src/script/build.sh index d1f41e0..de67025 100755 --- a/src/script/build.sh +++ b/src/script/build.sh @@ -1,13 +1,5 @@ #!/bin/bash echo '编译静态页面' -cd ./src/ui -npm i && npm run build -cd ../ -echo '清除缓存' - - -echo '将项目文件 cp 到部署目录' -mkdir -p ../dist/utils/static -cp -r ui/dist/static/ ../dist/utils/static \ No newline at end of file +cd ./src/ui && npm i && npm run build && cd ../ && mkdir -p ../dist/utils && cp -r ui/dist/static/ ../dist/utils/static/ \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 47c56e8..a3d1208 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,6 @@ "outDir": "dist", "resolveJsonModule": true, }, - "exclude": ["node_modules", "test/**.ts", "dist"], + "exclude": ["node_modules", "test/**.ts", "dist", "src/ui"], "include": ["src/**/*"] }