-
-
Notifications
You must be signed in to change notification settings - Fork 79
Change parser to allow parsing two script tags on <script setup>
#108
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
Conversation
b2edf5d
to
a5cf10c
Compare
a5cf10c
to
f3928aa
Compare
Hmm. Can't parse the following SFCs well. <script>
export let count = 42
</script>
<script setup>
let count = 42
</script> The current PR implementation is a parse error because it parses as a single script. export let count = 42
let count = 42 We need to parse it as a separate script, but I don't know how to merge the |
I also considered adding <script>
export let count = 42
</script>
<script setup>
let count = 42
</script> ↓ export let count = 42
{
let count = 42
} But the next SFC is an error. <script>
export let count = 42
</script>
<script setup>
import Comp from './comp.vue'
let count = 42
</script> ↓ export let count = 42
{
import Comp from './comp.vue'
let count = 42
} |
Changed to parse For example: <script>
export let count = 42
</script>
<script setup>
import MyComponent from './MyComponent.vue'
let count = 42
</script> ↓ export let count = 42
;
import MyComponent from './MyComponent.vue';
{
let count = 42
} |
This PR modifies the parser so that it can parse SFCs with two script tags.
However, the parser parses the two scripts only if the SFC has both
<script setup>
and plain<script>
.Related to #78