docs: improve types

This commit is contained in:
Philipp Kühn
2021-08-26 23:40:31 +02:00
parent afd021fffa
commit e0d7b01b1c
3 changed files with 9 additions and 11 deletions

View File

@@ -20,6 +20,7 @@
"@types/prosemirror-state": "^1.2.7",
"@types/prosemirror-transform": "^1.1.4",
"@types/prosemirror-view": "^1.17.2",
"@types/uuid": "^8.3.1",
"@vitejs/plugin-react-refresh": "^1.3.6",
"autoprefixer": "^10.3.1",
"iframe-resizer": "^4.3.2",

View File

@@ -1,4 +1,3 @@
// @ts-nocheck
import {
resolve,
basename,
@@ -53,7 +52,7 @@ export default defineConfig({
{
name: 'raw',
resolveId(id, importer) {
if (id.startsWith('raw!')) {
if (id.startsWith('raw!') && importer) {
const [, relativePath] = id.split('raw!')
const fullPath = join(dirname(importer), relativePath)
@@ -103,7 +102,7 @@ export default defineConfig({
{
name: 'source',
resolveId(id, importer) {
if (id === '@source') {
if (id === '@source' && importer) {
return `source!${dirname(importer)}!!${uuid()}`
}
},
@@ -163,7 +162,7 @@ export default defineConfig({
configureServer(viteDevServer) {
return () => {
viteDevServer.middlewares.use(async (req, res, next) => {
if (req.originalUrl.startsWith('/preview')) {
if (req?.originalUrl?.startsWith('/preview')) {
req.url = '/preview/index.html'
}
@@ -183,11 +182,4 @@ export default defineConfig({
}),
],
},
// server: {
// fs: {
// // Allow serving files from one level up to the project root
// allow: ['..']
// }
// }
})