Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import json file affected by "intifly/nuxt3" module installation #85

Open
johan-Rm opened this issue Aug 20, 2022 · 1 comment
Open

Comments

@johan-Rm
Copy link

when i import json file with typescript i get values ​​wrapped in functions

here is my code:

const getMapping = async () => import('~/config/mapping.json').then((r: any) => r.default || r)
const mapping = await getMapping()
console.log(mapping)

console.log result

{
  type: [Function: fn] { source: 'wordpress' },
  fields: {
    headline: [Function: fn] { source: 'title' },
    dateModified: [Function: fn] { source: 'modified' }
  }
}

original json file :

{
    "type": "wordpress",
    "fields":{
        "headline": "title",
        "dateModified": "modified"
    }
}

output file when I comment module '@intlify/nuxt3'

{
  type: 'wordpress',
  fields: { headline: 'title', dateModified: 'modified' }
}

installing the module changes the way all JSON files from a nuxt project are imported, is this a bug?

@duyleekun
Copy link

How are you fixing this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants