This function doesn't have a /*#__PURE__*/
prefix, which breaks tree-shaking. Moreover, when I try to prepend it myself through inject
option it gets stripped along with the entire string from the final bundle, which leaves you without CSS.
function inject(cssVariableName) {
return (
'\n' +
`/*#__PURE__*/ (${styleInjectFork})(${cssVariableName}${
Object.keys(styleInjectOptions).length > 0
? `,${JSON.stringify(styleInjectOptions, function(_key, value) {
if (typeof value === 'function') {
return value.toString();
}
return value;
})}`
: ''
});`
);
}
In my case, I forked styleInject
, because it's missing some features, so I had to compose it slightly different into the string (wrap it with brackets to turn it into expression, which is then invokable).
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too