Skip to content

Commit

Permalink
fix: 添加 netlify 文件以支持生产环境下的 history 模式
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed Apr 30, 2023
1 parent 003d9c6 commit 606270d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"shd101wyy.markdown-preview-enhanced",
"antfu.goto-alias",
"voorjaar.windicss-intellisense",
"yoavbls.pretty-ts-errors"
"yoavbls.pretty-ts-errors",
"bodil.prettier-toml",
"bungcip.better-toml"
]
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
".env": ".env.*",
"index.html": "LICENSE,.gitignore,README.md",
".eslintrc.json": ".eslint*,.prettier*,.editor*",
"vite.config.*": "package.json,uno.config.ts,tsconfig.json"
"vite.config.*": "package.json,uno.config.ts,tsconfig.json,*.toml"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand All @@ -37,5 +37,8 @@
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[toml]": {
"editor.defaultFormatter": "bodil.prettier-toml"
}
}
4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[[redirects]]
to = "/index.html"
from = "/*"
status = 200
2 changes: 1 addition & 1 deletion src/composables/useVisits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function useVisits() {
const text = await res.text()
return Number(text) ?? 0
} catch (error) {
console.log(error)
console.error(error)
return 0
}
})
Expand Down

0 comments on commit 606270d

Please sign in to comment.