systemjs / plugin-css

CSS loader plugin
MIT License
92 stars 60 forks source link

Ensure CSS loading in-order #128

Open guybedford opened 7 years ago

guybedford commented 7 years ago

The JS corresponding to the CSS load will always execute in the correct execution order of requires, so it should be possible to use this guarantee to ensure that the corresponding CSS files are arranged in the correct order.

This should be possible by gathering the style tags into two groups - currently loading, and loaded, which appear consecutively in the HEAD tag. The execution call would then move the style tag from the currently loading group and place it at the end of the loaded group, thus ensuring the correct style ordering.

Contributions very welcome here, otherwise will leave it up as a feature issue for the time being.