svgdotjs / svgdom

Straightforward DOM implementation to make SVG.js run headless on Node.js
MIT License
269 stars 53 forks source link

Fix conditional export for CommonJS #119

Open DevSDK opened 9 months ago

DevSDK commented 9 months ago

Hi folks, I have a problem using this package in the CommonJS environment in my company.

According to the nodejs specification [1], the 'require' key should be the target for CommonJS.

Therefore, change the target that is already built for the 'require' key for conditional exports.

[1] https://nodejs.org/api/packages.html#conditional-exports

Fuzzyma commented 9 months ago

Please use the esm package. I removed the support for csm to lower the burden of maintenance for me. There is a section in the readme on how to use it: https://github.com/svgdotjs/svgdom#use-svgdom-as-cjs-module