Skip to content

Commit

Permalink
fix : intlify#68 default is not a function problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZCube committed Jul 6, 2022
1 parent 7292b37 commit 071edbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/nuxt3/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ export const optionLoader = createUnplugin((options: LoaderOptions = {}) => ({
enforce: 'post',

transformInclude(id) {
const { pathname } = parseURL(id)
return pathname.endsWith(INTLIFY_VUEI18N_OPTIONS_VIRTUAL_FILENAME)
return false
},

async transform(code) {
Expand Down
4 changes: 3 additions & 1 deletion packages/nuxt3/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ const IntlifyModule = defineNuxtModule<IntlifyModuleOptions>({
filename: INTLIFY_VUEI18N_OPTIONS_VIRTUAL_FILENAME,
write: true,
getContents: () => {
return `${nuxt.options.dev ? "// 'vueI18n' option loading ..." : ''}`
return `export default () => Promise.resolve(${JSON.stringify(
options.vueI18n || {}
)})`
}
})

Expand Down

0 comments on commit 071edbb

Please sign in to comment.