lasso-js / lasso

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

How to force JS dependancy into the head #274

Open alexjalex opened 6 years ago

alexjalex commented 6 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 6 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