Open rschristian opened 3 years ago
Latest commit: 8aaf60fadc7a9cb88e7f93f3a58c49ace143551d
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Size Change: 0 B
Total Size: 65.3 kB
Summary
Closes #884 and #825
Each output can be individually given output paths now, there's no sharing of names/paths. This removes an over reliance upon
"main"
to provide output paths for every other format.There's no longer a guarantee of all output being in the same directory: based on the file paths, different formats can be output in different locations.
The
--output
flag is still functional, but only covers formats that are not provided an explicit path in thepackage.json
. For example, if we're missing"module"
but still outputting ESM, it will be output at<--output>/<pkg-name>.esm.{js/mjs}
For output formats that are not given an explicit path/name, they default to the package name. I think this or
index
are equally valid, but this a) matches our examples in the ReadMe (if we have an example module named "foo", the output tends to befoo.js
,foo.esm.js
, etc.) and b) real world usage. People tend to prefer naming output than keeping it asindex
from what I've seen, but YMMV.Edit: Both #825 and #938 bring up the filename specified with
"types"
not being acknowledged and I don't think it's something we can support. TSC itself outputs filenames as-is, there's no easy way (besides a post-build script) to have it instead output an arbitrary name for the entry file.rpt2
forgoes the Rollup process anyhow under certain circumstances and uses TS to write directly to the filesystem, so we don't necessarily have a good way of altering that post-build ourselves I don't think.