cancel
Showing results for 
Search instead for 
Did you mean: 

Add custom Javascript to Frontend from Module - Magento2

Add custom Javascript to Frontend from Module - Magento2

I am building a module and i need to load Javascript that must be generated in my module (NO theme) to the shop frontend.

Then, when a user enters on the web, the module has to generate js and inject to the shop frontend.

The js has variables that i have in the database, then i need join it with a Block and phtml to create it.

how can I do it?