Skip to content

Commit

Permalink
fix: Handle ESM Tailwindconfigs (fix #667) (#723)
Browse files Browse the repository at this point in the history
Co-authored-by: Bahul Neel Upadhyaya <[email protected]>
  • Loading branch information
schwarmco and bahulneel authored Aug 22, 2024
1 parent 0c4a6ea commit 7b6389f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function tailwindTokens(options: TailwindTokensOptions = {}): Plugin {
await api.fs.writeFile(api.path.resolve(api.pluginTempDir, 'style.css'), css)
const tailwindConfig = await api.moduleLoader.loadModule(tailwindConfigFile)
const { default: resolveConfig } = await import('tailwindcss/resolveConfig.js')
const resolvedTailwindConfig = resolveConfig(tailwindConfig)
const resolvedTailwindConfig = resolveConfig(tailwindConfig.default ?? tailwindConfig)
const storyFile = api.path.resolve(api.pluginTempDir, 'Tailwind.story.js')
await api.fs.writeFile(storyFile, storyTemplate(resolvedTailwindConfig))
api.addStoryFile(storyFile)
Expand Down

0 comments on commit 7b6389f

Please sign in to comment.