-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
Let's keep this brief. When in module mode the config doesn't work as expected. This has 2 problems to be more specific.
- The init command still generates a config in CJS format, which just means it just appears as an empty config when loaded. The config object it loads will just look like this:
{
"--": [],
"exclude": [
null
]
}
- The script doesn't select the default export so it won't read any of the options as you may expect. The expected way will not work:
export default {
"vueFiles": "./src/**/*.?(js|vue)",
"languageFiles": "./lang/**/*.?(json|yaml|yml|js)",
"exclude": [],
"output": false,
"add": false,
"remove": false,
"ci": false,
"separator": ".",
"noEmptyTranslation": ""
}
// the loaded config looks like this
{
"__esModule": true,
"default": {
"vueFiles": "./src/**/*.?(js|vue)",
"languageFiles": "./lang/**/*.?(json|yaml|yml|js)",
"exclude": [],
"output": false,
"add": false,
"remove": false,
"ci": false,
"separator": ".",
"noEmptyTranslation": ""
},
"--": [],
"exclude": [
null
]
}
Instead you'll have to write it like this:
export const vueFiles = './src/**/*.?(js|vue)'
export const languageFiles = './src/lang/**/*.?(json|yaml|yml|js)'
export const exclude = []
export const output = false
export const add = false
export const remove = false
export const ci = false
export const separator = '.'
export const noEmptyTranslation = ''
Metadata
Metadata
Assignees
Labels
No labels