Skip to content

Conditional CJS #30

Answered by frehner
webistomin asked this question in Q&A
Apr 6, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Can someone explain why we need to split the CJS module into production and development?

You don't necessarily need to; the document mentions that it's useful if you have additional logic and/or warnings for development mode, then it's useful. But if you don't, then there's no need.

And why don't we do the same with ESM?

I believe the document doesn't make the distinction between CJS and ESM for this; you should be doing the same thing for ESM. Is there some wording in there that lead you to not think this?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@webistomin
Comment options

@frehner
Comment options

Answer selected by webistomin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants