When insert CSS asynchronously, insert it before a style link, because the position of the css file will affect its weight.
mainTemplate.hooks.requireEnsure.tap(
...
'var head = document.getElementsByTagName("head")[0];',
'head.appendChild(linkTag);',
...
)
Can I pass in a string to replace the words bellow?
'head.appendChild(linkTag);'
Feature Use Case
I extracted a theme color file to switch theme colors. Then I want to insert CSS asynchronously before it (when dynamic import used) to keep the styles of theme color file override the inserted file.
Feature Proposal
When insert CSS asynchronously, insert it before a style link, because the position of the css file will affect its weight.
Can I pass in a string to replace the words bellow?
Feature Use Case
I extracted a theme color file to switch theme colors. Then I want to insert CSS asynchronously before it (when dynamic import used) to keep the styles of theme color file override the inserted file.