'Dynamic Bundling

My MVC Website has a feature allowing the client to customize the overall look of the website by choosing colors and images.

Currently, the feature is implemented via SCSS:

  • Everytime the client changes the customization settings, some SCSS variables are injected with the values he provided.
  • Afterwards, SCSS is compiled to a CSS file with a name like MyCustom_{Id}.css

This customization will be available to all my client's clients. Whenever the client is logged in, it will check which customization file he should be served, so I currently don't make use of the bundling feature, which has the drawback of me having to implement a feature so the browser asks for the new CSS everytime the customization changed.

Is there any way to make the bundling dynamic, as such depending on the request include a different file?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source