This plugin injects code into the same scope as the script code, but also introduces variables. These
variables can lead to errors when a script also contains a symbol with the same name. I have applied
some additional namespacing to make it more unlikely that these variable names would collide with
a user's code, and additionally less likely to collide with other generated code.
To reproduce the error, you can create a .vue file with the following content:
Looking at the output, likely candidates for collisions with user-generated code are:
render
script
staticRenderFns
normalizer
injectStyles
And there are a few that use different styles of escaping already:
__cssModules
__component__
I wasn't sure if those were based on conventions used elsewhere and as a result didn't touch them, however, I'm not exactly happy with the new situation of having __*, __*__ and __vue2_* all in the same file, so I'm open to which ever form of escaping the project maintainers are willing to accept.
This plugin injects code into the same scope as the script code, but also introduces variables. These variables can lead to errors when a script also contains a symbol with the same name. I have applied some additional namespacing to make it more unlikely that these variable names would collide with a user's code, and additionally less likely to collide with other generated code.
To reproduce the error, you can create a .vue file with the following content:
Looking at the output, likely candidates for collisions with user-generated code are:
And there are a few that use different styles of escaping already:
__cssModules
__component__
I wasn't sure if those were based on conventions used elsewhere and as a result didn't touch them, however, I'm not exactly happy with the new situation of having
__*
,__*__
and__vue2_*
all in the same file, so I'm open to which ever form of escaping the project maintainers are willing to accept.