question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Generating both dev and prod builds in library mode

See original GitHub issue

Is 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:open
  • Created 3 years ago
  • Reactions:10
  • Comments:8

github_iconTop GitHub Comments

1reaction
AdrianMrncommented, Sep 30, 2021

@ldexterldesign This fixed my issue, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Production | webpack
It is used by convention to determine dev-vs-prod behavior by server tools, build scripts, and client-side libraries. Contrary to expectations, process.env.
Read more >
Building for production - Lit.dev
This page focuses on recommendations for building an application that uses Lit components for production. For recommendations on build steps to perform on ......
Read more >
Configure build variants | Android Developers
This page shows you how you can configure build variants to create different versions of your app from a single project and how...
Read more >
Webpack how to build production code and how to use it
You can add the plugins as suggested by @Vikramaditya. Then to generate the production build. You have to run the the command. NODE_ENV=production...
Read more >
Creating libraries - Angular
Incremental builds functionality improves the library-development experience. Every time a file is changed a partial build is performed that emits the amended ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found