intlify / intlify/nuxt3

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

Open
#85 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
204
Forks
18
PR merge metrics
No merged PRs in 30d

Description

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

here is my code:

```javascript

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.