wix / stylable

Stylable - CSS for components
https://stylable.io
MIT License
1.26k stars 62 forks source link

fix(core): remove pure markers from js module output #2936

Closed idoros closed 5 months ago

idoros commented 5 months ago

This PR removed the /#PURE/ annotations from the JavaScript module output. The reason for this removal is that these markers appear to trigger errors with vite@5:

A comment "/ #PURE/" in "..." contains an annotation that Rollup cannot interpret due to the position of the comment. The comment will be removed to avoid issues

Although we currently do not conduct tests on vite (at all), this pull request introduces new tests. These tests are designed to verify the effectiveness of tree-shaking for different build tools, including webpack, rollup, and esbuild. The goal is to ensure that the removal of these markers does not adversely impact the final output.

The annotations have been completely removed as it appears they no longer influence tree-shaking. This could be due to improvements in the tree-shaking algorithm over time or because the module output has been simplified to the extent that these annotations are now redundant.


Note: this should be merged to stylable@5 first and then cherry-picked to master