5

How to correct combine multiple scss files in one css file?

My current configuration webpack.mix.js

mix.sass(
[
    'resources/assets/sass/one.scss',
    'resources/assets/sass/two.scss',
], 'public/css/style.css');

But it does not work.

I try first first mix.combined scss files, then mix.sass ...

But after 'npm run watch' i got looped crazy CLI.

1
  • 1
    You can have one main scss file and import everything in that Commented Feb 22, 2018 at 19:20

1 Answer 1

14

Instead of combining them through mix, import the stylesheets you need together in SCSS: https://sass-lang.com/guide#topic-5

If you want to keep them separate, make a new stylesheet that just imports the needed styles.

Sign up to request clarification or add additional context in comments.

2 Comments

@webdevdani Is something like this also possible for JS files?
@OzanKurt This depends on your JS build. If you're using modern build processes, you can use the regular ES2015 imports: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…

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.