How to connect third-party libraries in bem / project-stub?
-
Good afternoon, in a short time you need to understand how bem works)) downloaded https://github.com/bem/project -stub and installed, downloaded jquery and owl-carousel via bower, it is not clear how to connect them when building pages. Thank youJavaScript Anonymous, Aug 4, 2020
-
Oh ... In short will not work. Firstly, the project-stub is not a starter kit for quickly creating a website from scratch, but rather a demonstration of the concept of bem-tools (XJST-template engine, enb-collector, etc.). https://github.com/bem/bem-express is more suitable for website development, but and it has a higher entry threshold: there is close work with express.js, that is, it is also a full-fledged server on node.js.
jQuery is already included in the delivery of both project-stub and bem-express, since a framework from the stack for working with client-side JS i-bem.js works with jQuery.
There are two ways to connect third-party libraries:
- hardcode the library as described in the instructions and call initialization yourself;
- make a BEM module that uses the Y-Modules system to dynamically connect.
The second method is preferable, but also an order of magnitude more complicated.Anonymous - hardcode the library as described in the instructions and call initialization yourself;
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!