withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.36k stars 2.46k forks source link

temp tailwind.config.js file not removed. #5439

Closed chenxsan closed 1 year ago

chenxsan commented 1 year ago

What version of astro are you using?

1.6.10

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

Making any syntax error in tailwind.config.cjs, you'll see a .temp.xxxx.tailwindcss.config.cjs generated. Fixing that error in tailwind.config.cjs won't clean up that temp file.

I think we need to unlink that temp file in both try and catch here https://github.com/withastro/astro/blob/4b188132ef68f8d9951cec86418ef50bb4df4a96/packages/integrations/tailwind/src/index.ts#L51

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-1gh3v5?file=tailwind.config.cjs&on=stackblitz

Participation

matthewp commented 1 year ago

@chenxsan Yes, thank you! Probably this should be done in the finally (maybe in its own try/catch in case it fails). Would you be willing to submit a PR for this?