Skip to content

Commit

Permalink
fix: adopt forward-compatible approach to builder:watch
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 26, 2024
1 parent 5c1c0fc commit 90aecf0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { relative, resolve } from 'node:path'
import { defineNuxtModule, createResolver } from '@nuxt/kit'
import { name, version } from '../package.json'
import generateLocales from './generateLocales'
Expand Down Expand Up @@ -55,6 +56,7 @@ export default defineNuxtModule<ModuleOptions>({
}

nuxt.hook('builder:watch', async (_event, path) => {
path = relative(nuxt.options.srcDir, resolve(nuxt.options.srcDir, path))
if (path === csvFilePath) {
try {
await generateLocales(csvFileFullPath, outputDir)
Expand Down

0 comments on commit 90aecf0

Please sign in to comment.