Skip to content

Commit

Permalink
Merge pull request #1 from yusukebe/improve-settings
Browse files Browse the repository at this point in the history
improve vite settings
  • Loading branch information
lauragift21 committed Mar 13, 2024
2 parents e0554f1 + 1aa7026 commit 61813a0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tsconfig.json
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"moduleResolution": "Bundler",
"esModuleInterop": true,
"strict": true,
"lib": [
Expand All @@ -16,4 +16,4 @@
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx"
},
}
}
19 changes: 10 additions & 9 deletions vite.config.ts
@@ -1,31 +1,32 @@
import pagesBuild from '@hono/vite-cloudflare-pages'
import adapter from '@hono/vite-dev-server/cloudflare'
import pagesPlugin from '@hono/vite-dev-server/cloudflare-pages'
import honox from 'honox/vite'
import client from 'honox/vite/client'
import { defineConfig } from 'vite'

export default defineConfig(({ mode }) => {
if (mode === 'client') {
return {
build: {
rollupOptions: {
input: ['/app/style.css'],
output: {
assetFileNames: 'static/assets/[name].[ext]'
}
}
},
plugins: [client()]
}
} else {
return {
plugins: [
honox({
devServer: {
adapter,
plugins: [
pagesPlugin({
d1Databases: ['DB'],
d1Persist: true
})
]
adapter
}
}),
pagesBuild()
]
}
}
})
})
18 changes: 18 additions & 0 deletions wrangler.example.toml
@@ -0,0 +1,18 @@
name = "staff-directory"
compatibility_date = "2023-12-01"

# [vars]
# MY_VAR = "my-variable"

# [[kv_namespaces]]
# binding = "MY_KV_NAMESPACE"
# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# [[r2_buckets]]
# binding = "MY_BUCKET"
# bucket_name = "my-bucket"

[[d1_databases]]
binding = "DB"
database_name = "my-database"
database_id = ""

0 comments on commit 61813a0

Please sign in to comment.