-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose consistent dist
files across packages
#3445
Comments
I took a stab at this (nolanlawson@2d866c9) but it's actually incredibly tricky to get right given issues with ESM vs CommonJS:
I can't see any way forward except either 1) not exposing ESM for Node-only packages like Of course, all of these problems would go away if we were a pure-ESM package, but given Jest/Rollup/etc issues, it feels too early to force that on our consumers. |
The solution I decided on in #3456 was to not expose I also kept some |
dist
files across packages
Original description
Currently, each package in the monorepo has its own build script. Sometimes we use
tsc
, other times we userollup
. Each one has its ownrollup.config.js
. The output is sometimesdist
, sometimestypes
, and the outputdist
file names are occasionally different.Instead, we should standardize our output:
dist/
andtypes/
directories in the same way –dist/index.js
for ESM,dist/index.cjs
for CommonJS"main"
/"module"
/"typings"
keys in everypackage.json
This is technically a breaking change, since we would be changing the output format of our packages, which people might be relying on. (E.g.
import 'some-package/dist/deep/dependency/here.js'
)As of #3456, we now have a consistent build process across packages. What's inconsistent is our dist files, for backwards-compat reasons:
lwc/scripts/rollup/rollup.config.js
Lines 120 to 144 in cfb0424
We should drop these in LWC v3.0.0.
The text was updated successfully, but these errors were encountered: