HTML5 structure boilerplate js

I am wondering if anyone can test my understanding of what is meant for HTML5Boilerplate js directories. I understand that main.js is where I have to put all the site-specific javascript that I am the author of. Plugins.js is where I would place all jQuery plugins. Both main.js and plugins.js will be combined and minimized by the build process. Vendor.js contains javascript libraries. This directory will be instructed (if not already approved), but not concatenated.

If this is true, then my question is: where should something like a nice slider with a modular structure be placed? I think I want it to be minimized and concatenated so that it does not fall into the supplier directory. I do not believe that I can add javascript cuteslider to main.js or plugins.js without destroying its modular structure. Should I create a new directory and name it something like an application in order to save the cuteslider code and then change the assembly code for miniature and concatenated?

Here is a snippet of the cuteslider code structure

cute cute.2d.module.js cute.canvas.module.js cute.css3d.module.js cute.gallery.plugin.js cute.slider.js cute.transitions.all.js 
+4
source share
1 answer

First you should consider cuteslider as a plugin.

Add the necessary files to make the plugin work (cute.slider.js, cute.transitions.all.js and reply.min.js) in the plugins.js files.

Then add js to load the slider into your page in main.js as

 $(document).ready(function() { // code here to load cuteslider }); 

The modular view should be installed only in the main.js.

+1
source

Source: https://habr.com/ru/post/955092/


All Articles