You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When object spread operator is used ({ ...defaults, ...options }), in both the generated index.js and index.cjs (of a type: module package), those lines are replaced with a custom _extends function, which is added:
Object spread is supported in Node since v8.3 and my package specifies engines.node >= 12 so this is "useless" extra code in the output. Temp fix is to directly use Object.assign in source code instead of obj spread.
Another oddity I noticed was that there was generated code referring to document but this shouldn't be the case for Node builds?
The text was updated successfully, but these errors were encountered:
"engines" in your package.json is totally ignored by Microbundle.
That being said, #954 bumped the Node target to 12 from 8. I believe targeting 8 effectively means 8.0.0, hence no spread. Hasn't been released yet I don't think.
I've noticed following oddities when bundling for Node with the following command:
When object spread operator is used (
{ ...defaults, ...options }
), in both the generatedindex.js
andindex.cjs
(of atype: module
package), those lines are replaced with a custom_extends
function, which is added:Object spread is supported in Node since v8.3 and my package specifies
engines.node >= 12
so this is "useless" extra code in the output. Temp fix is to directly use Object.assign in source code instead of obj spread.Another oddity I noticed was that there was generated code referring to
document
but this shouldn't be the case for Node builds?The text was updated successfully, but these errors were encountered: