Skip to content

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

@johan-Rm

Description

@johan-Rm

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions