Skip to content

build.minify config for library mode is invalid #5451

@lixiangio

Description

@lixiangio

Describe the bug

After upgrading vite, the build.minify configuration is invalid, minify is disabled in lib mode, and it was available before. This configuration is confusing, I found the reason, I hope to keep this feature, it is very useful to me. I don't want to write an additional Rollup plugin for this requirement, I hope there are other simple solutions.
vuejs/core#2860 (comment)
06d86e4

Reproduction

// vite config
{
  "build": {
    "minify": true,
    "lib": {
      "name": 'vue',
      "entry": 'vue.js',
      "formats": ['es'],
      "fileName": () => `vue.js`,
    }
  },
}

System Info

System:
    OS: Linux 5.4 Ubuntu 21.10 LTS
  Binaries:
    Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
    npm: 7.24.0 - ~/.nvm/versions/node/v16.10.0/bin/npm
  Browsers:
    Chrome: 95.0.4638.54
  npmPackages:
    @vitejs/plugin-vue: ^1.9.3 => 1.9.3 
    vite: ^2.6.4

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions