The code below is the entire entry file, but the output is 1.6MB. All of react-icons is being included in the output, even though no icon is being used. Tree shaking would remove it, but the StylexPlugin seems to be interfering.
import { FaRegCircleQuestion } from "react-icons/fa6"
import * as x from "@stylexjs/stylex"
If you remove the second line, the size shrinks down to 0 bytes. Interestingly, if you remove the StylexPlugin from Webpack entirely, the output is around 3KB.
@nmn This issue pretty much nullifies the webpack plugin's usefulness for production. On the StyleX docs, maybe it's time to provide an additional disclaimer for the Webpack plugin.
Describe the issue
The code below is the entire entry file, but the output is 1.6MB. All of react-icons is being included in the output, even though no icon is being used. Tree shaking would remove it, but the StylexPlugin seems to be interfering.
If you remove the second line, the size shrinks down to 0 bytes. Interestingly, if you remove the StylexPlugin from Webpack entirely, the output is around 3KB.
My webpack.config.js
Expected behavior
The @stylexjs/webpack-plugin doesn't interfere with Webpack's tree shaking and optimization.
Steps to reproduce
npm install npm run prod
minimalExample.zip
Test case
No response
Additional comments
No response