From 410402807489bf4ad6ffb98a98b1d9d74be6f9da Mon Sep 17 00:00:00 2001 From: yue Date: Mon, 19 Aug 2024 08:46:27 +0900 Subject: [PATCH] fix: ensure dir exist before write --- packages/react/tsup.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react/tsup.config.ts b/packages/react/tsup.config.ts index b18477d4e..42a8c90fb 100644 --- a/packages/react/tsup.config.ts +++ b/packages/react/tsup.config.ts @@ -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'], @@ -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(