Answer the question
In order to leave comments, you need to log in
How do you organize JS code in the enterprise?
Friday question. The approach of many server programmers to writing the frontend is quite sloppy: inline styles, a bunch of , sheets in and all that.
What do you use on old big projects that require reasonable browser support to minimize namespace preference? What have you used before, how are your impressions? Have you tried to structure the code of such projects, what did you do for this? UPD: the question is not about how to approach the task, I have done this several times with varying degrees of success. I wonder what you think about strategies , about your experience , not about tools. !important
$(document).ready()
Answer the question
In order to leave comments, you need to log in
requirejs
No, we have angular, only 1 html. But if the code is so spread out, then this is a bad architecture of the entire application, something needs to be changed. For example, you should not write part of js in html, but part in files. Leave only separate js files. Server inserts should be replaced with calls to the API. Break everything into components so that each component is in its own folder along with its styles, scripts and static (pictures, fonts). Collect everything with some kind of collector (Gulp, for example). Then the mess will decrease by orders of magnitude.
Very simple, you need to describe non-amd files in the shim blockin the requirejs settings. Behind details - in docks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question