Skip to content

Commit

Permalink
fix: ensure dir exist before write
Browse files Browse the repository at this point in the history
  • Loading branch information
yue4u committed Aug 18, 2024
1 parent 9902f04 commit 4104028
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig } from 'tsup'
import { styledComponentsPlugin } from '@charcoal-ui/esbuild-plugin-styled-components'
import postcss from 'postcss'
import fs from 'node:fs/promises'
import path from 'node:path'

export default defineConfig({
entry: ['src/index.ts'],
Expand Down Expand Up @@ -49,6 +50,9 @@ export default defineConfig({
},
})

// https://github.com/evanw/esbuild/issues/2999
// this will be called before dist is created
await fs.mkdir(path.dirname(layeredCssFilePath), { recursive: true })
await Promise.all([
fs.writeFile(layeredCssFilePath, layeredCssOutput.content),
fs.writeFile(
Expand Down

0 comments on commit 4104028

Please sign in to comment.