I'm trying to work with the form code that gives me the greatest possible use of what was written, so for every feature I'll need to do in javascript / jQuery I control the individual version of every thing with git. / p>
Controlling this individual version, I happen to end up having a lot of files to import into the system load, my upload has a list like this (well summarized):
masker-0.0.5.js
navigation-0.0.1.js
validator-0.2.1.js
tiles-effects-1.0.0.js
tiles-navigation-1.0.0.js
Including external, third-party and inbound uploads, the list becomes really big, as only Bootstrap CSS-related features give ~ 30 additions to .js files only, not to mention style sheets.
Returning to my individual files, they are relatively small, averaging 3k characters.
My current load in the development environment is done with a class in PHP:
class local__jsPackages
{
public static function get_packages()
{
$files = '';
$packages = self::packages();
foreach ($packages as $import)
{
$path = $import['path'];
$file = $import['file'];
$version = $import['version'];
$files .= '<script src="' . $path . '/' . $file . '' . $version . '.js"></script>';
}
return $files;
}
private static function packages()
{
$packages = [
//Plugin Bootstrap
'0' => [
'path' => '../theme/admin/assets/global/plugins/bootstrap/js',
'file' => 'bootstrap',
'version' => (string) '.min'
]
//Dentro da array seguem todas as inclusões locais
];
return $packages;
}
}
And when it's passed to production, I manually group everything into a single giant file, that's the problem part of the process.
What is the best way to LOAD many files / methods / plugins into javascript?
PS: They should be loaded all at once, as the application should not allow the user to refresh the page without shifting.