-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c87c992
commit f8ed487
Showing
15 changed files
with
102 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GITHUB_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { PlatformProxy } from 'wrangler'; | ||
|
||
// You can generate the ENV type based on `wrangler.toml` and `.dev.vars` | ||
// by running `npm run typegen` | ||
type Cloudflare = Omit<PlatformProxy<Env>, 'dispose'>; | ||
type LoadContext = { | ||
cloudflare: Cloudflare; | ||
}; | ||
|
||
declare module '@remix-run/cloudflare' { | ||
interface AppLoadContext { | ||
env: Cloudflare['env']; | ||
cf: Cloudflare['cf']; | ||
ctx: Cloudflare['ctx']; | ||
cache: Cloudflare['caches']; | ||
} | ||
} | ||
|
||
export function getLoadContext({ | ||
context, | ||
}: { | ||
request: Request; | ||
context: LoadContext; | ||
}) { | ||
return { | ||
env: context.cloudflare.env, | ||
cf: context.cloudflare.cf, | ||
ctx: context.cloudflare.ctx, | ||
cache: context.cloudflare.caches, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,15 @@ | ||
import { | ||
unstable_vitePlugin as remix, | ||
unstable_cloudflarePreset as cloudflare, | ||
vitePlugin as remix, | ||
cloudflareDevProxyVitePlugin as remixCloudflareDevProxy, | ||
} from '@remix-run/dev'; | ||
import { defineConfig } from 'vite'; | ||
import tsconfigPaths from 'vite-tsconfig-paths'; | ||
import { getLoadContext } from './load-context'; | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
remix({ | ||
presets: [ | ||
cloudflare({ | ||
getRemixDevLoadContext(context) { | ||
return context; | ||
}, | ||
}), | ||
], | ||
}), | ||
remixCloudflareDevProxy({ getLoadContext }), | ||
remix(), | ||
tsconfigPaths(), | ||
], | ||
ssr: { | ||
resolve: { | ||
externalConditions: ['workerd', 'worker'], | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters