Feature Request: Generating both dev and prod builds in library mode
See original GitHub issueIs your feature request related to a problem? Please describe.
I’m building a library and I want to generate output similar to what popular libraries like React and Vue do: esm + cjs/umd builds for both dev and prod modes, with only prod builds being minified and having source maps.
Right now, library mode generates esm and umd for prod mode by default and I can enable sourcemaps with a single line in the vite config file.
Describe the solution you’d like
Would be nice to have a builtin option (possibly enabled by default) to also generate dev builds which are not minified and include conditional code that uses import.meta.env.DEV
(as mentioned here).
Describe alternatives you’ve considered
It should be possible to achieve this using rollupOptions
with custom input/output but I think this is a necessary feature for library authors.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:8
Top GitHub Comments
👋 https://github.com/vitejs/vite/discussions/3278#discussioncomment-721347
@ldexterldesign This fixed my issue, thanks!