Skip to content

Commit

Permalink
chore: make vite work
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaellis committed May 11, 2024
1 parent 6bef59f commit 20f935e
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 49 deletions.
22 changes: 10 additions & 12 deletions docs/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import type { MetaFunction, LinksFunction } from "@remix-run/node";
import type { MetaFunction, LinksFunction } from '@vercel/remix'
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import { Analytics } from "@vercel/analytics/react";
import styles from "./styles.css";
} from '@remix-run/react'
import { Analytics } from '@vercel/analytics/react'
import styles from './styles.css'

export const meta: MetaFunction = () => [
{
charset: "utf-8",
title: "Blog | Kitchen Sink",
viewport: "width=device-width,initial-scale=1",
charset: 'utf-8',
title: 'Blog | Kitchen Sink',
viewport: 'width=device-width,initial-scale=1',
},
];
]

export const links: LinksFunction = () => [{ rel: "stylesheet", href: styles }];
export const links: LinksFunction = () => [{ rel: 'stylesheet', href: styles }]

export default function App(): JSX.Element {
return (
Expand All @@ -31,9 +30,8 @@ export default function App(): JSX.Element {
<Outlet />
<ScrollRestoration />
<Scripts />
<LiveReload />
<Analytics />
</body>
</html>
);
)
}
20 changes: 12 additions & 8 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,30 @@
"private": true,
"sideEffects": false,
"scripts": {
"dev": "remix dev",
"build": "remix build",
"build": "remix vite:build",
"dev": "remix vite:dev",
"lint": "TIMING=1 eslint \"app/**/*.ts*\" \"scripts/**/*.ts*\"",
"start": "remix-serve ./build/server/index.js",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@remix-run/node": "^2.8.0",
"@remix-run/react": "^2.8.0",
"@remix-run/serve": "^2.8.0",
"@remix-run/server-runtime": "^2.8.0",
"@remix-run/node": "^2.9.2",
"@remix-run/react": "^2.9.2",
"@remix-run/serve": "^2.9.2",
"@remix-run/server-runtime": "^2.9.2",
"@vercel/analytics": "^1.2.2",
"@vercel/remix-entry-server": "^0.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^2.8.0",
"@remix-run/dev": "^2.9.2",
"@types/react": "^18.2.62",
"@types/react-dom": "^18.2.19",
"typescript": "^5.3.3"
"@vercel/remix": "^2.9.2-patch.2",
"typescript": "^5.3.3",
"vite": "^5.1.0",
"vite-tsconfig-paths": "^4.2.1"
},
"engines": {
"node": ">=18"
Expand Down
9 changes: 0 additions & 9 deletions docs/remix.config.js

This file was deleted.

18 changes: 18 additions & 0 deletions docs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { vitePlugin as remix } from '@remix-run/dev'
import { installGlobals } from '@remix-run/node'
import { vercelPreset } from '@vercel/remix/vite'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'

installGlobals()

export default defineConfig({
plugins: [
remix({
ignoredRouteFiles: ['**/.*'],
presets: [vercelPreset()],
serverModuleFormat: 'cjs',
}),
tsconfigPaths(),
],
})
Loading

0 comments on commit 20f935e

Please sign in to comment.