-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error loading a .vue file from node_modules #678
Comments
Also, it seems that it isnt even converting es6 -> es5, the output is still es6 (not just breaking on es6+ features) So, babel isnt actually converting the js for the script tag |
node that in the babel setup i have a regex to not exclude the folder (maybe this is this issue.. but i think it should work):
|
My exclude doesnt say that tho - i have it allowing that module... no?
…On 27 February 2017 at 13:03, Thorsten Lünborg ***@***.***> wrote:
well, If you tell babel-loader not to transpile anything from node_modules
it will do as you told it.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#678 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC8aNWv6TcBKtg9wzVYlT6uyZltytwORks5rgzotgaJpZM4MNjwE>
.
--
Tony Polinelli
|
I have added the exclude to the vue-loader config, and tested that it is
returning FALSE for the 'common-fe' paths.. and still i have es6 being
passed through to the app (not transpiled)
Im now using https://github.com/whitecolor/babel-exclude-ignore
{
test: /\.vue$/,
loader: 'vue',
exclude: excludeIgnore(['common-fe'], true)
},
On 27 February 2017 at 15:20, Tony Polinelli <tonypolinelli@gmail.com>
wrote:
… My exclude doesnt say that tho - i have it allowing that module... no?
On 27 February 2017 at 13:03, Thorsten Lünborg ***@***.***>
wrote:
> well, If you tell babel-loader not to transpile anything from
> node_modules it will do as you told it.
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <#678 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AC8aNWv6TcBKtg9wzVYlT6uyZltytwORks5rgzotgaJpZM4MNjwE>
> .
>
--
Tony Polinelli
--
Tony Polinelli
|
This is more or less a Babel problem - the fact that it resolves |
For anyone else stumbling upon this issue, here's a short TLDR of the issue. The problem Sometime in Babel v7, the behaviour for resolving There is a great write-up and discussion here: Affected Vue plugins All these have a Possible solutions
Do note that this might include the |
I've managed to get around my similar issues by specifically telling webpack where to resolve modules and loaders, and also by resolving the babel-presets and plugins at at runtime.
Now load the babelrc file and resolve the full paths at runtime, and include the source-code path:
The preset/plugin part I got from this issue |
Thanks @laander and @jeppebemad! I found that the existence of a .babelrc file in my targeted node_modules sub-directory made no difference. Even when there was no .babelrc file there at all, the directory was not getting transpiled. The good news is that specifying babel config options directly in my webpack config file did fix this problem! For me, I just deleted the .babelrc file from my main application repo and specified all my options right in the webpack config file.
|
I am trying to share a 'common' library of my components between a few projects, and want to simply npm link another repo - then import from that module - eg: import 'common-fe/components/XX.vue'
I was expecting that this would just work, except it seems that it is erroring on my es7 features - in my bable.rc I use the legacy decorators. It seems that babel isnt using that preset for the files parsed in the node_module (only in the main project).
eg:
If i add a bable.rc to the 'common' repo then i get other errors:
i have npm installed the plugins in the common repo - but this doesnt help.
So, it seems that the code is being parsed as per the settings in the node_module?
I'd prefer not to have to compile the code to es5, should it be possible to use es6 like this?
The text was updated successfully, but these errors were encountered: