-
Notifications
You must be signed in to change notification settings - Fork 87
Transpiled code not converting all instances of const
for Vue
#298
Comments
The configuration seems OK. I can't help you further though, unless you provide a repository at which I could take a look. |
Thanks @Andarist for the help. The repo is at https://github.com/rojakcoder/randomizer. I've got some additional findings. On my laptop, the transpilation works fine. Laptop is using node 8.9.4, npm 6.5.0. On my desktop, the same problem occurs which is at the outer most scope, the This feels like an environment issue but I have no clue what that might be. |
I have the exact same issue. I'm using node v11.7.0 with npm 6.5.0 and I'm on a linux laptop. |
Can't reproduce it on node@10 and node@11 :/ Are those leftover |
I'm facing the same issue but all Demo repo.testsAlready tested several variations of babel configs, similars to the ones provided above, tested node@10 and @11 (latests) and also this advice from #260 (comment) without any luck. |
@renatodeleao in your case everything works as expected, those |
Oo 🤦♂️ I don't know what to say besides.. i'm sorry for wasting your time @Andarist 😞 |
From my limited knowledge of Vue, it seems to be coming from the Vue library. Specifically, it occurs in the function |
This might be a problem then, most likely babel({
...JSON.parse(require('fs').readFileSync('./.babelrc', 'utf8')),
runtimeHelpers: true,
sourceMap: true,
extensions: ['.js', '.vue']
}) and check if that fixes you issue? |
I can't replicate the issue even on the desktop now. I have no idea what is happening... |
I've gone through issue #260 - I also have a similar problem but the suggested solution does not work for me.
Similar but different problem. Not all
const
keywords are replaced withvar
- seemingly those at the top-level are converted whereas those inside functions are not.Be happy to hear if this is turns out to be my configuration problem rather than an issue with the plugin.
My Rollup configuration:
My .babelrc file:
The text was updated successfully, but these errors were encountered: