Skip to content

Commit

Permalink
fix: optionally generate sourcemap
Browse files Browse the repository at this point in the history
  • Loading branch information
stafyniaksacha committed Apr 15, 2023
1 parent 570ea24 commit e6c5ffb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default createUnplugin<Options | undefined>((userOptions) => {

return {
code: s.toString(),
map: s.generateMap({ source: id, includeContent: true }),
map: options.sourcemap
? s.generateMap({ hires: true })
: undefined,
}
}

Expand All @@ -48,7 +50,9 @@ export default createUnplugin<Options | undefined>((userOptions) => {

return {
code: s.toString(),
map: s.generateMap({ source: id, includeContent: true }),
map: options.sourcemap
? s.generateMap({ hires: true })
: undefined,
}
}
},
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface Options {
fontsource?: FontsourceFonts
google?: GoogleFonts
typekit?: TypeKitFonts
sourcemap?: string
}

export interface CustomFontFace {
Expand Down

0 comments on commit e6c5ffb

Please sign in to comment.