Skip to content

vite项目 vue3 在打包的时候 无法排除dist相应的文件夹 #881

@672064406zerui

Description

@672064406zerui

Describe the bug

部分配置如下

Image Image Image

我打包的文件夹名字 是根据环境变量VITE_OUT_DIR 控制的。生成后是dist-web-prod 现在exclude的正则排除不掉 打包的文件夹,打包之后在文件里把打包文件夹里的文件声明出来了。除非我把outDir写死为 环境变量的名字 才有效。我不知道问题出在哪

Reproduction

https://github.com/672064406zerui/unplugin-vue-comp-demo.git

System Info

System:
    OS: Windows 11 10.0.22635
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400F @ 2.60GHz
    Memory: 10.03 GB / 31.78 GB
  Binaries:
    Node: 20.12.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.5.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.12.1 - C:\Program Files\nodejs\pnpm.CMD

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions