Skip to content

Commit 398efb1

Browse files
committed
chore: update checks
1 parent 68710db commit 398efb1

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

packages/runtime/src/helpers/dev.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { resolve } from 'path'
22

3-
import { NetlifyPlugin } from '@netlify/build'
3+
import { OnPreBuild } from '@netlify/build'
44
import execa from 'execa'
55
import { unlink, existsSync } from 'fs-extra'
66

77
import { writeDevEdgeFunction } from './edge'
88
import { patchNextFiles } from './files'
99

1010
// The types haven't been updated yet
11-
export const onPreDev: NetlifyPlugin['onPreBuild'] = async ({ constants, netlifyConfig }) => {
11+
export const onPreDev: OnPreBuild = async ({ constants, netlifyConfig }) => {
1212
// Need to patch the files, because build might not have been run
1313
await patchNextFiles(resolve(netlifyConfig.build.publish, '..'))
1414

packages/runtime/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
warnForRootRedirects,
3232
} from './helpers/verification'
3333

34-
const plugin: NetlifyPlugin & { onPreDev?: OnPreBuild; onDev?: OnPreBuild } = {
34+
const plugin: NetlifyPlugin = {
3535
async onPreBuild({
3636
constants,
3737
netlifyConfig,
@@ -220,7 +220,10 @@ const plugin: NetlifyPlugin & { onPreDev?: OnPreBuild; onDev?: OnPreBuild } = {
220220
},
221221
}
222222
// The types haven't been updated yet
223-
const nextRuntime = (_inputs, meta: { events?: Set<string> } = {}): NetlifyPlugin & { onPreDev?: OnPreBuild } => {
223+
const nextRuntime = (
224+
_inputs,
225+
meta: { events?: Set<string> } = {},
226+
): NetlifyPlugin & { onPreDev?: NetlifyPlugin['onPreBuild'] } => {
224227
if (!meta?.events?.has('onPreDev')) {
225228
return {
226229
...plugin,

packages/runtime/src/templates/edge/next-dev.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ const exists = async (relativePath: string) => {
8989
}
9090

9191
const handler = async (req: Request, context: Context) => {
92-
// if (!Deno.env.get('NETLIFY_DEV')) {
93-
// return
94-
// }
92+
if (!Deno.env.get('NETLIFY_DEV')) {
93+
// Only run in dev
94+
return
95+
}
96+
9597
let middleware
9698
// Dynamic imports and FS operations aren't allowed when deployed,
9799
// but that's fine because this is only ever used locally.

packages/runtime/src/templates/edge/runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ globalThis.NFRequestContextMap ||= new Map()
4646

4747
const handler = async (req: Request, context: Context) => {
4848
if (Deno.env.get('NETLIFY_DEV')) {
49-
console.log('is dev')
49+
// Don't run in dev
5050
return
5151
}
5252
const url = new URL(req.url)

0 commit comments

Comments
 (0)