⊗tlWpCsIS 27 of 55 menu

Importing CSS Styles into Webpack

In Webpack, you can import CSS styles directly into a JavaScript file. Like this:

import './styles.css';

The imported styles will be inserted directly into the JavaScript build file. Then, when the bundle is connected to an HTML file, the script will insert these styles into the style tag.

However, Webpack can't import styles that easily. To do this, you need to make some settings. We'll do them in the next lessons.

enru