tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.03k stars 1.27k forks source link

Mark Vue and React packages as side-effect free #929

Closed thecrypticace closed 1 year ago

thecrypticace commented 1 year ago

Apparently adding an exports field implicitly marks a package as having side-effects in some cases even when direct imports of a file didn't previously do so.

Rollup and esbuild seem to not care about this when dealing with files directly. But Vite's internal node resolution logic does. I'm guessing Remix might be in a similar situation here. We export pure render functions for both React and Vue so marking our packages with "sideEffects": false should be fine.

Fixes #926

szechyjs commented 1 year ago

Updating to v2.0.15 breaks our CRA builds with the following error.

Module not found: Error: Resolving to directories is not possible with the exports field (request was ./24/solid/)
thecrypticace commented 1 year ago

@szechyjs What does your import statement look like?

szechyjs commented 1 year ago

@szechyjs What does your import statement look like?

import { BriefcaseIcon, HandRaisedIcon, ClipboardDocumentListIcon, ClockIcon } from '@heroicons/react/24/solid/';