Closed t4t5 closed 6 years ago
LGTM
btw I will remove the second arg returnValue
later since it's not really necessary.
what about insertTop: true
instead of position: 'top'
? it seems that there is not any other possible value for position
.
I changed the option name to insertAt
for clarity.
I think you might want to keep the option open for future possible values by not just being a boolean. I noticed that the webpack style-loader allows you to insert the style tag before a specific element for example. Might be an interesting feature to adopt in the future perhaps?
Sometimes, it is not desirable to always inject the
<style>
tag at the end of<head>
, since you might want to override some of the styles in CSS.This adds a third parameter for custom options, where you can specify:
Works in a similar way as: https://github.com/webpack-contrib/style-loader#insertat