How to automatically include NPM dependencies in index.html via <script> tags in a VUE JS WEBPACK project?

I know there is a GRUNT-BOWER plugin that automatically includes BOWER dependencies in the index.html file through tags every time you install any new bower package.

Is there any similar tool that automatically injects / includes NPM dependencies in index.html?

FYI project - VUE-CLI WEBPACK project. Can this be achieved via WEBPACK or do I need a dedicated build tool for this?

+3


source to share


1 answer


If you are already using webpack you can have a look at the html-webpack-plugin . It will create a file .html

with your packages added as script tags.



html-webpack-plugin combined with vendor bundling should help with this issue.

+1


source







All Articles