刮刮前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
620 B

const parser = require('@babel/parser')
const scopedComponentTraverse = require('../lib/babel/scoped-component-traverse')
const {
state: {
components
}
} = scopedComponentTraverse(parser.parse(
`
import VanIcon from '../icon/index.vue'
import VanPopup from '../icon/popup.vue'
import VanLoading from '../icon/loading.vue'
exports.default.components = Object.assign({
'van-icon': VanIcon,
'van-popup': VanPopup,
'van-loading': VanLoading
},exports.default.components || {})`, {
sourceType: 'module',
plugins: [
'typescript'
]
}), {
components: []
})
console.log(components)