Skip to content

Commit

Permalink
chore: vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Mar 9, 2024
1 parent 2690ce7 commit 7d6f90e
Show file tree
Hide file tree
Showing 4 changed files with 488 additions and 834 deletions.
8 changes: 8 additions & 0 deletions src/cli/commands/vercel-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ export async function build() {

ensureDirSync('./.vercel/output')
ensureDirSync('./.vercel/output/static')

if (pathExistsSync('./public'))
copySync('./public', './.vercel/output/static')

ensureDirSync('./.vercel/output/static/static')
copySync(
'./node_modules/frog/_lib/dev/static',
'./.vercel/output/static/static',
)

writeJsonSync('./.vercel/output/config.json', {
version: 3,
routes: [
Expand Down
9 changes: 5 additions & 4 deletions src/dev/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ import { uid } from './utils/uid.js'
import { validateFramePostBody } from './utils/validateFramePostBody.js'

const staticPath = '/dev/static'
const hasStaticBundle = existsSync(
join(dirname(fileURLToPath(import.meta.url)), './static/entry-client.js'),
)
const hasStaticBundle =
true ||
existsSync(
join(dirname(fileURLToPath(import.meta.url)), './static/entry-client.js'),
)

export function routes<
env extends Env,
Expand Down Expand Up @@ -104,7 +106,6 @@ export function routes<
if (text.includes(ngrokHostname))
text = text.replace(ngrokHttpRegex, 'https$2')

console.log({ text })
const metadata = htmlToMetadata(text)
const { context, frame } = metadata

Expand Down
Loading

0 comments on commit 7d6f90e

Please sign in to comment.