Skip to content
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

Ensure working with Vue 3 + custom babel config #258

Closed
lmiller1990 opened this issue Jul 29, 2020 · 11 comments
Closed

Ensure working with Vue 3 + custom babel config #258

lmiller1990 opened this issue Jul 29, 2020 · 11 comments
Labels

Comments

@lmiller1990
Copy link
Member

Issue found here: vuejs/vue-cli#5714

@lmiller1990
Copy link
Member Author

Should be good in 5.0.0-alpha.2

@Amour1688
Copy link
Member

I got error in 5.0.0-aplha.3.

image

image

My Babel config

https://github.com/vueComponent/ant-design-vue/blob/feat-vue3/.babelrc

@lmiller1990
Copy link
Member Author

I will take a look at your project. I guess it isn't respecting .babelrc? 🤔

@Amour1688
Copy link
Member

I will take a look at your project. I guess it isn't respecting .babelrc? 🤔

yeah, it works when I renamed it to babel.config.js.

@lmiller1990
Copy link
Member Author

I think the later versions of babel don't support .babelrc. Is this a good enough fix for your project? Or do we need to leave this open?

@Wizard67
Copy link

Wizard67 commented Sep 8, 2020

How to suport <script setup>?

@lmiller1990
Copy link
Member Author

I have not tried this yet. I was hoping it would "just work" - the SFC compiler (should) take care of it, mostly.

What happens when you tried it?

@Wizard67
Copy link

Wizard67 commented Sep 8, 2020

I have not tried this yet. I was hoping it would "just work" - the SFC compiler (should) take care of it, mostly.

What happens when you tried it?

@vue/runtime-core warns [Vue warn]: Property "x" was accessed during render but is not defined on instance. when I run the test script.

reproduction link: https://github.com/Wizard67/vue3-test

@lmiller1990
Copy link
Member Author

lmiller1990 commented Sep 9, 2020

Yep, we need to do a check for <script setup>. This should be fairly easy, I will look into it tomorrow or Friday.

More info here: https://github.com/vuejs/rfcs/blob/sfc-improvements/active-rfcs/0000-sfc-script-setup.md#transform-api

@jolting
Copy link
Contributor

jolting commented Apr 1, 2021

<script setup> works. The example needs to be updated a bit because the syntax changed. ``` <script setup lang="ts"> import { defineProps, ref } from 'vue' const props = defineProps({ msg: String }) const count = ref(0) </script>

@lmiller1990
Copy link
Member Author

Script setup keeps changing. We should update the dependencies here and make sure it works with the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants