hakhsin
2 months ago
125
0
Mix

How can I import all .scss files automatically?

Posted 2 months ago by hakhsin

Hi, My laravel resources app structure is like this:

  • resources
    • vuesin
      • components
        • Tree
          • _tree.scss
          • Tree.vue
          • ...

Now, how can I import all .scss files automatically in laravel mix? I try below code, but it doesn't work:

// Import Vuesin Scss
const files = require.context('./resources/packets/vuesin/components', true, /\.scss$/);
let styles = [];

files.keys().map(function (key) {
    styles.push(files(key));
});

Please sign in or create an account to participate in this conversation.