Skip to content

Commit

Permalink
Merge pull request #27 from danielroe/absolute-builder-watch-paths
Browse files Browse the repository at this point in the history
fix: adopt forward-compatible approach to `builder:watch`
  • Loading branch information
dulnan authored Jul 1, 2024
2 parents 275303c + 69ebf33 commit c42b45b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fileURLToPath } from 'url'
import type { Types } from '@graphql-codegen/plugin-helpers'
import { type SchemaASTConfig } from '@graphql-codegen/schema-ast'
import { resolve } from 'pathe'
import { relative, resolve } from 'pathe'
import { defu } from 'defu'
import { type BirpcGroup } from 'birpc'
import {
Expand Down Expand Up @@ -474,6 +474,7 @@ declare module '#graphql-documents' {
})
nuxt.hook('nitro:build:before', (nitro) => {
nuxt.hook('builder:watch', async (_event, path) => {
path = relative(nuxt.options.srcDir, resolve(nuxt.options.srcDir, path))
// We only care about GraphQL files.
if (!path.match(/\.(gql|graphql)$/)) {
return
Expand Down

0 comments on commit c42b45b

Please sign in to comment.