Preprocess bundles, not files
necolas opened this issue · comments
The preprocessing step should be run on the generated bundle, rather than individual files. This will make sure that all the variables are known ahead of time and that you get the expected output.
Could you give an example of a generated bundle?
When I'm looking through the Suit components I just see one or more CSS files. If the order was important that could be configured in the Grunt task
The theme is a simple example - https://github.com/suitcss/theme. It won't be applied unless the preprocessing is done once all the dependencies are resolved and the files combined into a single string that is handed to the preprocessor (giving the processor all the variables and values it needs to correctly substitute).
That's why I do the preprocessing outside of the Component(1) CLI build step. For example, it would be just before the write step here:
grunt-suitcss/tasks/grunt-suitcss.js
Line 31 in c8b64c8
Ah, I understand.
I will look into this. Thanks
@necolas Done some re-factoring and the task can either build and preprocess the component package or just preprocess plain CSS files that are written as Suit components.
Not ready yet but thoughts welcomed
Think this is basically resolved now. Just needs some test fix up