Skip to content

Commit 388419e

Browse files
committed
refactor(module): simplify imports and remove pages directory check
1 parent d9660e0 commit 388419e

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/module.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import path, { join } from 'node:path'
2-
import fs, { existsSync } from 'node:fs'
1+
import path from 'node:path'
2+
import fs from 'node:fs'
33
import {
44
addComponentsDir,
55
addImportsDir,
@@ -103,15 +103,6 @@ export default defineNuxtModule<ModuleOptions>({
103103
customRegexMatcher: undefined,
104104
},
105105
async setup(options, nuxt) {
106-
const pagesDir = join(nuxt.options.srcDir, 'pages')
107-
if (!existsSync(pagesDir)) {
108-
throw new Error(
109-
'[nuxt-i18n-next] The "pages" directory is missing in your Nuxt project.\n'
110-
+ 'This module relies on the presence of the "pages" directory for proper routing and localization support.\n'
111-
+ 'Please create a "pages" directory in your source folder (usually at the root of your project) and try again.',
112-
)
113-
}
114-
115106
const defaultLocale = process.env.DEFAULT_LOCALE ?? options.defaultLocale ?? 'en'
116107

117108
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)