Only one ESM module (".esm.js") is generated instead of ".esm.production.js" or "*.esm.development.js"

I've also tried to pass the --format cjs,esm,udm but only one ESM file is generated.

Two ESM files (production & development) should be generated.
Generate prod/dev files where "dev" is minified.
Previous version (0.6.1) used to generate prod/dev versions.
| Software | Version(s) |
| ---------------- | ---------- |
| TSDX | 0.7.2
| TypeScript | 3.5.2
| Browser | N/A
| npm/Yarn | yarn version 1.16.0
| Operating System | Windows 10 build 1903
Hi, this worked wrong. Two bundles required commonjs wrapper which breaks the point of using es modules and breaks all optimisations. All bundlers are able to replace NODE_ENV with production or development. This is a kind of standard for react modules. With webpack it's only one option mode.
basically i think this is working as designed. if you're using the ESM build, you're gonna want to do the minification higher up the chain. lmk if that sounds wrong @TrySound
Thank you. @TrySound & @sw-yx
I have questions in-line below.
_Sorry about the ignorance and I'd like to learn what I don't know._ πββοΈ
@TrySound
Two bundles required commonjs wrapper which breaks the point of using es modules and breaks all optimisations.
Would having prod/dev ESM outputs break optimizations so one ESM file is generated?
All bundlers are able to replace NODE_ENV with production or development.
I tried the build with "NODE_ENV" to "production" for tsdx build and the ESM is not minified.
This is a kind of standard for react modules. With webpack it's only one option mode.
I am not sure where Webpack fits π
@sw-yx
if you're using the ESM build, you're gonna want to do the minification higher up the chain.
Would it require using Webpack to minify tsdx-generated ESM module?
@dance2die You may use any bundler. All of them supports NODE_ENV replacement and minification.
There is not way to deliver two production and development bundles to user without requirement to manually alias paths. So we provide a single bundle which user bundler should process.
this worked wrong
Ah. I kind of see what you mean.
Would my understanding be correct that,
v0.6.1 generated prod/dev versions for both ESM & CJS bundles, it required users to set which path to be the main package to use using an alias path (would it be resolve.alias in case of Webpack?)
CJS is in prod/dev bundles as to follow React module practice
and ESM is now a single file, which tsdx users should manually minify "higher up the chain".
Lastly, would "node module resolution" be what I should be research/learning to better understand this convo?
I will close the issue as this is working as designed.
Tbh I copied the esm setup from microbundle which I think builds minified esm. Maybe so you can use <script type=module> or something idk? Anyways. It is working as expected. Itβs up to your app to optimize it
Thank you, Jared.
Will do more research π