Skip to content

Commit

Permalink
Merge pull request #42 from xibman/v2
Browse files Browse the repository at this point in the history
feat!(opting nuxt 4): opting Nuxt 4 apply new Directory Structure
  • Loading branch information
xibman authored Jan 4, 2025
2 parents 90e5fed + 7128234 commit e9cb1cb
Show file tree
Hide file tree
Showing 40 changed files with 12 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions docs/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default defineNuxtConfig({
routeRules: {
'/api/search.json': { prerender: true },
},
future: {
compatibilityVersion: 4,
typescriptBundlerResolution: true,
},
compatibilityDate: '2024-12-24',
typescript: { strict: false },
hooks: {
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default createConfigForNuxt({
typescript: true,
},
dirs: {
src: ['./playground', './docs'],
src: ['./playground/app', './docs/app'],
},
}).append([
...eslintPluginJsonc.configs['flat/recommended-with-jsonc'],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
export default defineNuxtConfig({
modules: ['../src/module', '@nuxtjs/i18n', '@nuxt/ui'],
devtools: { enabled: true },
future: {
compatibilityVersion: 4,
typescriptBundlerResolution: true,
},
compatibilityDate: '2024-12-24',

i18n: {
defaultDirection: 'ltr',
defaultLocale: 'en-GB',
langDir: './locales',
langDir: 'locales',
lazy: true,
locales: [
{
Expand Down
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default defineNuxtModule<ModuleOptions>().with({
: [],
).map(({ code }) => code)

const languageFiles = await readdir(resolve('./runtime/locales'))
const languageFiles = await readdir(resolve('./runtime/i18n/locales'))

const locales = languageFiles.reduce<LocaleObject[]>((acc, file) => {
const code
Expand All @@ -102,7 +102,7 @@ export default defineNuxtModule<ModuleOptions>().with({

nuxt.hook('i18n:registerModule', (register) => {
register({
langDir: resolve('./runtime/locales'),
langDir: resolve('./runtime/i18n/locales'),
locales,
})
})
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e9cb1cb

Please sign in to comment.