From f362f13e03c10a58e6a1d8d1c668dae5d97c5aeb Mon Sep 17 00:00:00 2001 From: remorses Date: Fri, 1 Nov 2024 18:10:41 +0100 Subject: [PATCH] cleanup things --- next-superjson/src/utils.ts | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/next-superjson/src/utils.ts b/next-superjson/src/utils.ts index 6dde02c..82a81ef 100644 --- a/next-superjson/src/utils.ts +++ b/next-superjson/src/utils.ts @@ -3,15 +3,13 @@ import path from 'path' const enabled = !!process.env.DEBUG_ELACCA export const logger = { log(...args) { - enabled && console.log('[elacca]:', ...args) + enabled && console.log('[superjson]:', ...args) }, error(...args) { - enabled && console.log('[elacca]:', ...args) + enabled && console.log('[superjson]:', ...args) }, } -export const elaccaDirective = 'skip ssr' - const filesToSkip = ([] as string[]).concat( ...['_document', '_error'].map((name) => [ name + '.js', @@ -21,7 +19,7 @@ const filesToSkip = ([] as string[]).concat( ]), ) -export function shouldBeSkipped({ pagesDir, filePath, program = null as any }) { +export function shouldBeSkipped({ pagesDir, filePath }) { if (!filePath.includes('pages' + path.sep)) { return true } @@ -37,14 +35,6 @@ export function shouldBeSkipped({ pagesDir, filePath, program = null as any }) { console.log('skipping', abs, 'because outside of pagesDir', pagesDir) return true } - if (!program) { - return false - } - const dir = program.node.directives?.find( - (x) => x.value?.value === elaccaDirective, - ) - if (!dir) { - return true - } + return false }