fix(compiler-sfc): should extract comment for import or type declarations (#2107)
fix #2102
This commit is contained in:
@@ -28,6 +28,15 @@ describe('SFC compile <script setup>', () => {
|
||||
)
|
||||
})
|
||||
|
||||
test('should extract comment for import or type declarations', () => {
|
||||
assertCode(
|
||||
compile(`<script setup>
|
||||
import a from 'a' // comment
|
||||
import b from 'b'
|
||||
</script>`).content
|
||||
)
|
||||
})
|
||||
|
||||
test('explicit setup signature', () => {
|
||||
assertCode(
|
||||
compile(`<script setup="props, { emit }">emit('foo')</script>`).content
|
||||
|
||||
Reference in New Issue
Block a user