Skip to content

Commit

Permalink
fix: improve webpack support, close #236
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 18, 2022
1 parent 2a239f3 commit 3840db9
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,18 @@ const unplugin = createUnplugin<Options>((options = {}) => {
}
return null
},
loadInclude(id) {
return isIconPath(id)
},
async load(id) {
const config = await resolved
if (isIconPath(id)) {
const code = await generateComponentFromPath(id, config) || null
if (code) {
return {
code,
map: { version: 3, mappings: '', sources: [] } as any,
}
const code = await generateComponentFromPath(id, config) || null
if (code) {
return {
code,
map: { version: 3, mappings: '', sources: [] } as any,
}
}

return null
},
rollup: {
api: {
Expand Down

0 comments on commit 3840db9

Please sign in to comment.