PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, March 9, 2022

[FIXED] How to compile multiple CSS files into two CSS files output based on each one required in different layout using Laravel Mix

 March 09, 2022     css, laravel, laravel-8, laravel-mix     No comments   

Issue

I have two CSS files app.css(RTL CSS) and en-app.css(LTR CSS) I want to compile them using Laravel Mix into two files, How I can (I don't want to paste them directly in Public/CSS directory Instead I want to use advantages of Mix)


Solution

It should be quite straightforward. Usually you should have something like mix.js('resources/js/app.js', 'js').sass('resources/sass/app.scss', 'css'); in you mix file. As you can see you can stack multiple calls to the mix function. So you will need to make a separate call to .scss mix.js('resources/js/app.js', 'js').sass('resources/sass/app.scss', 'css').sass('resources/sass/en-app.scss', 'css');

After running the compiler you should see the two files in the ./public/css/ folder.

Note: If you are using plain CSS you will need to replace .scss with .css function in the mix file.



Answered By - Lightning00Blade
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing