Aron-Spiess's avatar

Where do I add custom.css in webpack?

I've created a tailwind.css

where in my web pack do I add the css file?

mix.js("resources/js/app.js", "public/js/app.js")
    .sass("resources/sass/app.scss", "public/css/app.css")
    .sourceMaps();

if (mix.inProduction()) {
    mix.version();
}
0 likes
2 replies
Tippin's avatar
Tippin
Best Answer
Level 13

@aron-spiess If you want it as it's own file, and not in app.css, you can append another .sass()

mix.js("resources/js/app.js", "public/js/app.js")
    .sass("resources/sass/app.scss", "public/css/app.css")
    .sass("resources/sass/tailwind.scss", "public/css/tailwind.css")
    .sourceMaps();

If you want it included within app.css, then open app.scss and add the import to wherever your tailwind scss file is

@import "tailwind";
Aron-Spiess's avatar

Ended up putting it in my app.scss, that was easiest. I was originally putting it in my app.css and it kept on getting removed when I repacked. Thank you

Please or to participate in this conversation.