Can you please rephrase your question. I'm not sure what you want to achieve at this point. Do you want to compile everything at once or do you want to be compiled separately?
Big project LARAVEL MIX Problem
i have a scenario :
my project has 3 part layout Design -
- Front End
- User panel
- Admin Panel
for that i have Global css typeof panel CSS and Page wise individually internally CSS
for this reason i want to use laravel mix == but my question is if i all css [global + panel wise ] is combine in laravel webpack mix then its possible ?
and mu all of js can i use webpack mix ..
and how do i use image which one use project
Hi , thanks for your reply - is it possible compiled separately for separate panel ? like when i hit admin panel then admin template css and js load or work -- is this possible in web pack mix .
i tried last days in one combined but its not work - i just want to know my project situation wise can i use webpack mix use in laravel ? thats is thank you
Guys, I managed to figure it out. I am coming from Yii2 where you have frontend and backend directories, and everything is split. I've always created a new subdomain for the backend, which I did now as well. That's why the root was public/admin. Now I've just created a prefix 'admin' instead of a subdomain and everything works perfectly.
This is not help full - because i have one -domain and everything work single domain not sub domain -
Sorry for late reply , i want to share my project senario .
i wan to use mix but there are three types css and js one is globally second is panel wise public panel , user panel , admin panel , and third is page wise css and js , i cannot understand how to use by mix , because if i use globally then ok all are supported same for full project but i don't know how to use mix for panel wise when user panel hit then use selected css - in mix .... am i make you understand ? @bobbybouwmann
Watch this: https://laracasts.com/series/learn-laravel-mix/episodes/10
It does not matter how many "panels" you have, just call for whatever you need in that layout:
<link href="{{ asset('css/whatever.css') }}" rel="stylesheet">
// another panel
<link href="{{ asset('css/thispanel.css') }}" rel="stylesheet">
// yet another panel
<link href="{{ asset('css/panel_whatever.css') }}" rel="stylesheet">
@towhid this stuff is fairly easy, just think it through. But the video I referenced, Jeffrey makes it look so easy.
hmm this is not free only this video --- and its not clearly understand in this video
The point is have a layout file for each panel if you expect to show different style CSS. Otherwise you're going to need one large CSS file.
But yes all of your CSS can still work with mix.
It doesn't sound like mix has anything to do with this. It sounds like you just need to create 2 different layout templates instead of just one.
One template loads the common css, and the public css. Use that for those public views.
The other loads the common css, and the admin css. Use that for those admin views.
Another alternative is to just combine them into a single css file. I'd probably go that route unless there is a huge difference between frontend/backend css, like using completely different css frameworks or something.
I think you can add a new file at your resourses/js as admin.js and resources/css as admin.sccs. After you can add in your webpack.
mix.js('resources/js/app.js', 'public/js')
.js('resources/js/admin.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.sass('resources/sass/admin.scss', 'public/css');
So you can import it in you admin panel.
BTW this is unsolved problem , i just avoid this issue . thanks all
Please or to participate in this conversation.