Skip to content

Commit

Permalink
feat: add custom formatType in destination for other type
Browse files Browse the repository at this point in the history
  • Loading branch information
mrajaeim committed Sep 11, 2024
1 parent 0c3a97c commit e0de7f0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ export const makeSdTailwindConfig = ({
throw new Error('formatType must be "js" or "cjs"')
}

const destination =
type !== 'all'
? `${type}.tailwind.${formatType}`
: `tailwind.config.${formatType}`

return {
preprocessors,
source: getConfigValue(source, ['tokens/**/*.json']),
Expand Down Expand Up @@ -135,10 +140,7 @@ export const makeSdTailwindConfig = ({
buildPath: getConfigValue(buildPath, 'build/web/'),
files: [
{
destination:
type !== 'all'
? `${type}.tailwind.js`
: `tailwind.config.${formatType}`,
destination,
format: 'tailwindFormat'
}
]
Expand Down

0 comments on commit e0de7f0

Please sign in to comment.