Ramazan's avatar

how to add external css file into laravel-mix s

i wan change my custom style into sass by laravel-mix how to add my file into webpack.mix.js

0 likes
6 replies
Cruorzy's avatar

in resources/css/app.scss

@import "yourfile";
1 like
Ramazan's avatar

my custom css file is in public/css how to add that in webpack.mix.js may I change the css directory into resource file or no

Cronix's avatar

Yes, your stuff should be in /resources. Mix will copy the compiled assets to /public. Look at how the default is set up in your webpack.mix.js file.

Ramazan's avatar

my file extension is css i should change that to sass can you show me and example please

Cronix's avatar
Cronix
Best Answer
Level 67
  1. copy your css file to /resources/assets/css/yourfile.css
  2. add @import "../css/yourfile.css"; to the bottom of /resources/assets/sass/app.scss
  3. If you haven't already installed the node dependencies, run npm install
  4. run npm run dev

Your custom css is now included in the /public/css/app.css file.

7 likes
deepikalgj's avatar

how to import external js file? I want to add multiple js file externally and use as app.js.

1 like

Please or to participate in this conversation.