question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mix.sass does not allow glob params

See original GitHub issue

webpack.mix.js

mix.sass('resources/assets/styles/**/*.scss', 'public/styles')

Let’s say I have 2 files:

resources/assets/styles/app.scss
resources/assets/styles/content/content.scss

when I run the npm run dev it compile the scss into css and “copies” them to public directory:

public/styles/app.css
public/styles/content/content.css

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

17reactions
maxfentoncommented, Sep 13, 2018

Is there a way in that main.scss to use globbing like @import 'components/*.scss' ?

Update (2018-09-13) : managed this by adding import-glob-loader to package.json and adding this to webpack.mix.js:

mix.webpackConfig({
  module: {
    rules: [
      {
        test: /\.scss/,
        loader: 'import-glob-loader'
      }
    ]
  }
});
1reaction
paper9ollcommented, Feb 1, 2017

Hi thanks for the reply.

Say i got multiple scss files like 20+ for individual pages, does that means i have to declare mix.sass for every single one of scss files?

Read more comments on GitHub >

github_iconTop Results From Across the Web

mix.sass does not allow glob params · Issue #241 - GitHub
Say i got multiple scss files like 20+ for individual pages, does that means i have to declare mix.sass for every single one...
Read more >
Glob | Laravel Mix Extension
Laravel mix extension that add support for glob. It wrap nicely around laravel mix. Add the glob feature, with some cool features.
Read more >
Making a Sass mixin with optional arguments - Stack Overflow
When called what I really want is that if no $inset value is passed, nothing is output, rather than it compiling to something...
Read more >
Sass: @use
CSS files loaded as modules don't allow any special Sass features and so can't expose any Sass variables, functions, or mixins. In order...
Read more >
How I manage my CSS/SCSS properties - Level Up Coding
@media queries don't allow global CSS variables, they simply do not work when tested. However, SCSS variables do work, since the compiler replaces...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found