Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dist directory is not cleaned if one of outDir is . (root) #435

Open
xsjcTony opened this issue Sep 20, 2024 · 1 comment
Open

dist directory is not cleaned if one of outDir is . (root) #435

xsjcTony opened this issue Sep 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@xsjcTony
Copy link

xsjcTony commented Sep 20, 2024

Environment

Node.js v20.15.0
pnpm v9.11.0
unbuild v2.0.0

Reproduction

E.g. if I have multiple entries, but one of the ourDir is root, it will only clean ./ but not in ./dist

entries: [
  'src/index',
  { input: 'src', outDir: '.', pattern: ['**/*.css'], builder: 'mkdist', loaders: ['postcss'] },
],

Snipaste_2024-09-21_01-18-38
The file in ./dist folder will only be overwritten, but in case any garbage files, they wouldn't be cleaned.


If I change to another subdirectory, it's going to work

entries: [
  'src/index',
  { input: 'src', outDir: './foo', pattern: ['**/*.css'], builder: 'mkdist', loaders: ['postcss'] },
],

Snipaste_2024-09-21_01-20-40

Describe the bug

See Reproduction. This is causing files in ./dist folder is not cleaned, where I want the .css file to be in the root directory to publish to NPM.

Additional context

In CI it's causing it to crash because it's really cleaning up the whole root directory, resulting in
Snipaste_2024-09-21_01-35-07
Even if I set cleanDist in one of the entry, it's not going to help, it's still cleaning the root

entries: [
  'src/index',
  { input: 'src', outDir: '.', pattern: ['**/*.css'], builder: 'mkdist', loaders: ['postcss'], cleanDist: false },
],

Logs

No response

@xsjcTony xsjcTony added the bug Something isn't working label Sep 20, 2024
@xsjcTony
Copy link
Author

Seems not an issue anymore via #343 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant