Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Gulp Basics Compile Sass with Gulp Turn Sass into CSS, automatically

@4:15, he mentions its better for gulp to src a single sass file instead of multiple ones, like src("path/to/sassDir")

Is this also the case for say other assets, fonts, images, js, etc. since we cant import them from a main asset file - ex. app.scss?

From the series Turn Sass into CSS, automatically - with Huston Hedinger.

2 Answers

Sean T. Unwin
Sean T. Unwin
28,690 Points

This is not typically the case for other assets as there will be multiple images, js files, and possibly fonts. You should load those for as many as required. This is commonly seen with the globbing pattern -- '**/*.js' -- so that we can grab all the files of the same type from a specific directory or series of directories.

The base Sass file should include all the other Sass partials, therefore when compiling from Sass to CSS the transpiler is processing only one file, as far as it is concerned, since everything is essentially concatenated into the base Sass file.

Sean T. Unwin Thanks!