Skip to content

Commit

Permalink
fix: not found static
Browse files Browse the repository at this point in the history
  • Loading branch information
wss-git committed Oct 9, 2021
1 parent 073f1dd commit f980028
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 1 addition & 9 deletions src/script/build.sh
Original file line number Diff line number Diff line change
@@ -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
cd ./src/ui && npm i && npm run build && cd ../ && mkdir -p ../dist/utils && cp -r ui/dist/static/ ../dist/utils/static/
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"outDir": "dist",
"resolveJsonModule": true,
},
"exclude": ["node_modules", "test/**.ts", "dist"],
"exclude": ["node_modules", "test/**.ts", "dist", "src/ui"],
"include": ["src/**/*"]
}

0 comments on commit f980028

Please sign in to comment.