sproutcore / build-tools

SproutCore Build Tools
12 stars 7 forks source link

Design error: handling of sc_static and static_url is done too early #38

Closed mauritslamers closed 9 years ago

mauritslamers commented 10 years ago

I reached this conclusion after finding out that in a relative build the urls for the legacy theme were wrong.

The problem essentially is that the url generated for sc_static and static_url are now generated in the very beginning of the build process, and the generated url is based on the relative path between the file containing the sc_static or static_url "call" and the referred file.

However, in the process of combining files the generated url should be reconsidered as the combined file is different from the original file. In order to get a correctly generated url, the sc_static or static_url parsing should be performed by the "final" file, being a file about to be saved or served, or perhaps even by a process outside the file itself. Thoughts?

mauritslamers commented 10 years ago

Additional thought: Fixing this problem might be more complex than it seems, as we have to take sc_static or static_url out of a css file before it is parsed by sass as it will crash on encountering sc_static.

nicolasbadia commented 9 years ago

Fixes by https://github.com/sproutcore/build-tools/commit/0ad4fe645a17310f96580c025c11f862df2fa8c6.