vite
vite copied to clipboard
fix: support process each out dir when there are two or more
Description
prepareOutDir only process the build.outDir, and the actions include empty dir and copy public dir for those defined in output.dir will be ignored.
Additional context
I notice that it will build output options twice if config.build.watch defined, so I promote the process to above.
What is the purpose of this pull request?
- [x] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [ ] Other
Before submitting the PR, please make sure you do the following
- [x] Read the Contributing Guidelines.
- [x] Read the Pull Request Guidelines and follow the Commit Convention.
- [x] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g.
fixes #123). - [ ] Ideally, include relevant tests that fail without this PR but pass with it.
I found a problem about the split regexp, fixed it.
The original regexp will be incorrect when the skip paths includes more than two levels of nesting.
empty(dir, ['a/b/c', 'a/b/d'])
@qmhc we discussed this PR in today's team meeting and we think we can move forward with it. Before merging we should resolve the open discussions. We decided that the public files should be copied multiple times, to each output.dir.