R
R
Roman Dobro2018-09-20 23:08:16
JavaScript
Roman Dobro, 2018-09-20 23:08:16

What or how to create a script.js - the core for managing the loading of modules?

Task: it is necessary to create a loader - a kernel that should load other allowed modules.
A module is an application (widget) that has a logic script and a set of different libraries, for example: FancyBox, etc.
In short:
1. loaded on the core.js page, which receives, for example, a list of modules that need to be used on the page
2. We connect all js files of all modules.

I looked in the direction of requirejs, but it seems that the sites write that you should not use it.

What will anyone recommend and how to properly organize the structure?

I would like that:
- the ability to use jquery libraries from other developers (fancybox, Slide, etc.)
- not to think about the js loading sequence
- use different versions of libraries, (possibly)
- create and use isolated modules, in general, so that there are no conflicts with those libraries that can already be used on the page to which our scripts will be connected - the core

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Dobro, 2018-09-22
@bleznec_ua

Thanks for the example.
The idea is that the modules would also be isolated.
And also what would be in the main script - the core, for example, some methods that would be available in all widgets that are loaded

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question