wix / stylable

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

fix(esbuild): minify bug #2899

Closed idoros closed 9 months ago

idoros commented 9 months ago

This PR addresses two critical issues that were causing esbuild to fail during the build process when the minify configuration was applied.

Both of these issues arose due to content removal by the minification process, which interfered with the expected behavior of the stylable stylesheet ordering:

  1. Comment-Dependent Sheet Paths: The first issue stemmed from the reliance on comments injected by esbuild to determine stylesheet paths. These comments were being removed when minify was enabled, leading to a runtime-build error.
  2. Start/End Markers Removal: The second issue pertained to the start and end markers inserted by the stylable plugin. These markers were sometimes eliminated as part of code optimization because they lacked uniqueness.

To resolve these issues, this PR eliminates the dependence on esbuild comments and introduces uniquely identifiable markers that will remain intact even when minification is applied.