4

In my Laravel project I use both SASS and CSS: SASS used for dependencies (fontawesome, Bootstrap) - via NPM and plain CSS across deep folder structure (BEM). I want to concatenate all CSS, compile SASS and concatenate it all in a single .css file. Same with JS: plain JS files in my BEM structure need to combine with single app.js file which needs to be processed by Webpack. I tried this:

mix.js('resources/assets/js/app.js')
    .scripts('resources/assets/blocks/**/*.js')
    .version('public/js/app.js');

mix.sass('resources/assets/sass/app.scss')
    .styles('resources/assets/blocks/**/*.css')
    .version('public/css/app.css');

But it doesn't work - only manifest file is created:

{
  "/js/app.js": "/js/app.js",
  "/css/app.css": "/css/app.css",
  "/mix.js": "/mix.js"
}
1
  • what if you change all your .css files to .scss (with a script) - Sass will then be able to compile them Commented Aug 14, 2017 at 22:39

1 Answer 1

5

Here is an example:

mix.sass('resources/assets/sass/app.scss', 'public/css').styles([
    'node_modules/animate.css/animate.min.css',
    'public/css/app.css'
],'public/css/app.css');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.