Skip to content

Commit c2845ed

Browse files
authored
fix : #68 default is not a function problem. (#73)
1 parent 7292b37 commit c2845ed

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/nuxt3/src/loader.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ export const optionLoader = createUnplugin((options: LoaderOptions = {}) => ({
1616
enforce: 'post',
1717

1818
transformInclude(id) {
19-
const { pathname } = parseURL(id)
20-
return pathname.endsWith(INTLIFY_VUEI18N_OPTIONS_VIRTUAL_FILENAME)
19+
return false
2120
},
2221

2322
async transform(code) {

packages/nuxt3/src/module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ const IntlifyModule = defineNuxtModule<IntlifyModuleOptions>({
7272
filename: INTLIFY_VUEI18N_OPTIONS_VIRTUAL_FILENAME,
7373
write: true,
7474
getContents: () => {
75-
return `${nuxt.options.dev ? "// 'vueI18n' option loading ..." : ''}`
75+
return `export default () => Promise.resolve(${JSON.stringify(
76+
options.vueI18n || {}
77+
)})`
7678
}
7779
})
7880

0 commit comments

Comments
 (0)