Answer the question
In order to leave comments, you need to log in
How to use Bower?
I have a project with something like this structure:
lang/
— ru.json
audio/
— audio.ogg
popup/
— css/
— — fontello/
— — popup.css
— — jquery.mCustomScrollbar.min.css
— img/
— — image.png
— plugins/
— — jquery.mCustomScrollbar.concat.min.js
— — linkify.min.js
— — Emoji.js
— popup.html
— popup.js
— popup-constructor.js
index.html
jquery-2.1.4.min.js
index.js
get.js
Answer the question
In order to leave comments, you need to log in
If the problem is only copying assets to the folder with built scripts, then grunt-contrib-copy.
I just want to insert the picture "Occam's razor", what problem are you solving?
Firstly, jquery must be connected from any cdn, you must have a reason that you know exactly why you put it in the project.
What's the difference how much it occupies on the disk if you connect only minified versions through script src.
Why copy anything?
Ideally, I would like to get a copy of my project, where files for index.html are separately compressed: index.js+get.js. And for popup.html: popup.js+popup-constructor.js+<all files from bower excluding jQuery>, popup.css+<all files from bower>.
And so that the newly compressed files are automatically connected in these .html files.
you can solve part (if not all) of the issues through grant usemin: in Dev in html you write addresses (css and js), around usemina conditional comments, when everything is copied to the prod, set up a usemin task and it will replace your jicquery and others with links on minified versions, and if I'm not mistaken, it will glue it, then whatever you say.
And there is like a plugin for a grant, which replaces the link to cdn.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question