martonlederer / esbuild-plugin-postcss2

Use postcss with esbuild
MIT License
33 stars 19 forks source link

Temp file cleanup on Windows #13

Open nobrayner opened 3 years ago

nobrayner commented 3 years ago

I was working on a project on a Windows machine, with the source code stored under C:\d\project, and upon trying to use this plugin, found that it was generating bad temp file paths along the lines of C:\Users\d\project\date-filename.css

To explore this a bit further, I then moved the project code to be located in C:\Users\username\d\project, which then started working - albeit with a still incorrect temp file location of C:\Users\username\AppData\d\project\date-filename.css (the temp path for Windows is C:\Users\username\AppData\Local\Temp)

I hadn't set the rootDir property in the plugin, so it was using process.cwd() with... Interesting results 🤦‍♂️

As part of playing around with this, I also found that Windows does not automatically clean up temp files, and the developer is expected to clean these files up themselves (ref: https://superuser.com/a/296827)

martonlederer commented 3 years ago

I dont't use windows, but if you create a PR, I can totally take a look at it :D