Zend certified PHP/Magento developer

Updating the type attribute of all CSS and JS references in the HEAD

I created a new theme in Magento 2 extending the default Magento Luma theme.

However, now I want to make some very specific customizations to all CSS and JS files referenced in the .

I want to change all CSS references that look like this:


to look like this:


and all JS references that look like this:


to look like this:


Notice that the type attribute changes from text/{file_type} to text/{file_type}/custom, where {file_type} is either css or javascript.

What files need to be updated/extended to make this work?