Skip to content

Lib mode format: es.min #6555

@yyx990803

Description

@yyx990803

Clear and concise description of the problem

Currently when building in lib mode we do not minify the ES build because that would remove pure annotations and break treeshaking. However, this is assuming that the ES build is only used with bundlers. In the future, more users could be using ES builds over CDNs with native ES imports, so a minified ES build could be necessary for those cases.

Suggested solution

// vite config
build: {
  lib: {
    formats: ['es', 'es.min']
  }
}

Alternative

lib: { minifyES: true }

Additional context

vuejs/petite-vue#112

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