optimized client assets generator

pull/49/head
A1Gard 3 months ago
parent 3d7a03e703
commit 3879d00c44

@ -66,6 +66,7 @@ class clientAssetGenerator extends Command
$files = File::allFiles(resource_path() . '/js/client-custom');
foreach ($files as $file) {
if ($file->getType() == 'file' && $file->getExtension() == 'js') {
$js .= 'import "./client-custom/' . $file->getBasename() . '";' . PHP_EOL;
}
@ -73,10 +74,14 @@ class clientAssetGenerator extends Command
}
// add parts scss & js
foreach (Part::distinct()->get() as $part) {
$variables .= '@import "../views/segments/' . $part->segment . '/'
. $part->part . '/' . $part->part . '";' . PHP_EOL;
$js .= 'import "../views/segments/' . $part->segment . '/'
. $part->part . '/' . $part->part . '.js";' . PHP_EOL;
if (filesize(__DIR__.'/../../../resources/views/segments/' . $part->segment . '/' . $part->part .'/' . $part->part . '.scss' ) > 10) {
$variables .= '@import "../views/segments/' . $part->segment . '/'
. $part->part . '/' . $part->part . '";' . PHP_EOL;
}
if (filesize(__DIR__.'/../../../resources/views/segments/' . $part->segment . '/' . $part->part .'/' . $part->part . '.js' ) > 10){
$js .= 'import "../views/segments/' . $part->segment . '/'
. $part->part . '/' . $part->part . '.js";' . PHP_EOL;
}
}
// save scss

@ -14,31 +14,10 @@ import "./client-custom/windowLoader.js";
import "../views/segments/preloader/PreloaderCircle/PreloaderCircle.js";
import "../views/segments/menu/RecetMenu/RecetMenu.js";
import "../views/segments/slider/SliderSimple/SliderSimple.js";
import "../views/segments/products/LatestProducts/LatestProducts.js";
import "../views/segments/posts/PostsIconSimple/PostsIconSimple.js";
import "../views/segments/index/CounterGrid/CounterGrid.js";
import "../views/segments/categories/CategoriesFavImageLinks/CategoriesFavImageLinks.js";
import "../views/segments/posts/PostIndexImage/PostIndexImage.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/menu/AplMenu/AplMenu.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/card/NsCard/NsCard.js";
import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar.js";
import "../views/segments/product/ProductKaren/ProductKaren.js";
import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar.js";
import "../views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.js";
import "../views/segments/post/PostSidebar/PostSidebar.js";
import "../views/segments/clips_page/ClipListGrid/ClipListGrid.js";
import "../views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.js";
import "../views/segments/invoice/LianaInvoice/LianaInvoice.js";
import "../views/segments/clip/DorClip/DorClip.js";
import "../views/segments/galleries_page/GalleriesList/GalleriesList.js";
import "../views/segments/gallery/GallaryGrid/GallaryGrid.js";
import "../views/segments/compare/CompareProducts/CompareProducts.js";
import "../views/segments/login/LoginPatternBg/LoginPatternBg.js";
import "../views/segments/register/SimpleRegister/SimpleRegister.js";
import "../views/segments/customer/AvisaCustomer/AvisaCustomer.js";
import "../views/segments/attachments_page/DenaAttachList/DenaAttachList.js";
import "../views/segments/attachment/AttachmentWithPreview/AttachmentWithPreview.js";
import "../views/segments/contact/MeloContact/MeloContact.js";

Loading…
Cancel
Save