Open 7iomka opened 4 years ago
I think it might be possible to make the codemod support that, or at least handle the error gracefully.
Notice however that we cannot support all possible code variations that users might do to their main.js.
The safest thing is to leave the structure of the new Vue({})
part as it is.
Notice however that we cannot support all possible code variations that users might do to their main.js.
Yes, of course, no one is talking about supporting any custom file customization options, but I think it's possible to do a search new Vue({})
, and if param is not inline object, but defined variable, try to find this variable and make similar additions inside it.
Since currently I do not see any workarounds that would not break the assembly.
I googled this error and there are people who have encountered it but had no idea about the reason. Now we know.
Version
4.1.2
Environment info
Steps to reproduce
1) Change main.js file
Before:
After
2) install plugin, for example: vue add i18n
What is expected?
Plugin is installed, and inside app object will be added i18n prop
What is actually happening?
Errors in console: