web:rollup updates main
and module
in package.json regardless of current data or the format
option
#9817
Labels
main
and module
in package.json regardless of current data or the format
option
#9817
Current Behavior
When using
web:rollup
executor and pass"format": ["cjs"]
, or whatever combination of formats, thepackage.json
of the built library gets always the"main"
and"module"
updated as such:Likewise if I have specified in my
libs/{myLib}/package.json
a value formain
andmodule
those value get overwritten by the executor.Expected Behavior
I would expect that if I specify a different
format
option to the executor other than the default["esm", "umd"]
that would attempt to update only the targeted package.json keys with the correct file names .For instance if I specify"format": ["cjs"]
i would expect the executor to only try to updatemain
withindex.cjs.js
or whatever name outputted by rollup for that format, and leavemodule
as is found inlibs/{myLib}/package.json
.Steps to Reproduce
This can be reproduce wherever, it is enough to look at the source code responsible for this package update https://github.com/nrwl/nx/blob/master/packages/web/src/executors/rollup/rollup.impl.ts#L308-L311
Environment
The text was updated successfully, but these errors were encountered: