-
-
Notifications
You must be signed in to change notification settings - Fork 8k
import.meta.globEager('../assets/svgIcon/*.svg?raw') #5304
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestp2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Description
Clear and concise description of the problem
将资源批量引入为其他格式。
Batch import resources into other formats.
Suggested solution
import svg from '../assets/svgIcon/github.svg?raw'
console.log(svg)
// Now results 现在的结果
// <svg t="1634195145119" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"...
const files = mport.meta.globEager('../assets/svgIcon/*.svg?raw')
console.log(files)
// Now results 现在的结果
// {}
// Expected results 期望的结果
/*
{
'../assets/svgIcon/github.svg': {
raw: '<svg t="1634195145119" class="icon" viewBox="0 0 1024 1024" version="1.1" ...',
...
},
'../assets/svgIcon/logo.svg': {
raw: '<svg t="1634195051463" class="icon" viewBox="0 0 1024 1024" version="1.1" ...',
...
}
}
*/Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestp2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)