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 Adding Styles to Your Application

Juan Francisco Andrade Álvarez
Juan Francisco Andrade Álvarez
23,997 Points

Does webpack only transpiles css and sass into the <style> tag?

HI, Does webpack only transpiles css and sass into the <style> tag, or can it also transpile into a css bundle to be included in a html file, as the javascript bundle? If so, is it necessary any special loader? What would it be the way to do it? Thanks.

1 Answer

That's just the default behaviour, but you can output an actual CSS file, and bundle all the styles together by following the steps in the stylesheets Webpack docs.

If you only have one entry point (index.js or app.js for instance), then you would only get one CSS file outputted.