Is it possible to exclude a specific css or js from drupal'l css and js aggregation ?
For ex: Exclude custom-style.css from being aggragated ?
Similar to Drupal 7, the setting preprocess
key to FALSE
will prevent a JS or CSS library from being aggregated.
mylibraryname:
css:
theme:
css/custom-style.css: {preprocess: false}
Same works for JavaScript
cuddly-slider:
version: 1.x
js:
js/cuddly-slider.js: {preprocess: false}
dependencies:
- core/jquery
- core/drupalSettings
As documented on Adding stylesheets (CSS) and JavaScript (JS) to a Drupal 8 module