DEV: Use separate files for theme component stylesheets (#12214)

This switches to outputting a separate file for each theme component CSS
asset. We have separate CSS plugin files, separate JS files
(for plugins/themes/components), it makes sense to do the same for
component CSS assets.

Benefits:
- easier debugging
- fixes a regression with theme component sourcemaps
- changes to theme components are updated individually

With HTTP/2, there is also no performance downside to having additional
files in the initial request.
This commit is contained in:
Penar Musaraj
2021-02-26 07:44:15 -05:00
committed by GitHub
parent bb3d5e9758
commit f57a49c2f9
6 changed files with 41 additions and 31 deletions

View File

@ -58,7 +58,7 @@ class Stylesheet::Manager
theme_ids = [theme_ids] unless Array === theme_ids
theme_ids = [theme_ids.first] unless target =~ THEME_REGEX
theme_ids = Theme.transform_ids(theme_ids, extend: false)
theme_ids = Theme.transform_ids(theme_ids)
current_hostname = Discourse.current_hostname