I have a small Flask app which currently sources jQuery and highlight.js from external servers. I\'d like to make these local dependencies which I pull in via NPM.
W
You need Bower and you already have NPM. This is all you need to achieve what you want.
Basically, you will have to create a package.json
in the root to install Bower using NPM. Then you will have to create a bower.json
to define what all libraries you need, example jQuery.
Then your flow will be like:
npm install
bower install
This will basically install bower for you and the other frontend libraries you defined in bower.json
.
All bower components will go into a directory called bower_components
in your root. This is where all your installed bower packages will reside. You can use these packages inside your templates now.
Also see this to make sure that bower's packages are installed in your static
or assets
folder which you want to serve.