lasso-js / lasso

Advanced JavaScript module bundler, asset pipeline and optimizer
580 stars 75 forks source link

How to force JS dependancy into the head #274

Open alexjalex opened 5 years ago

alexjalex commented 5 years ago

I'm trying to add TypeKit api into my app which requires the JS to be loaded in the head tag, not at end of body like most JS.

Is this not possible?

pajaydev commented 5 years ago

@alexjalex You can use lasso-slot to inject js inline wherever you want. https://github.com/lasso-js/lasso#custom-attributes-for-script--style-tags. You can check this for example https://github.com/lasso-js/lasso-inline-slots