Uncategorized Links

Bundle your CSS, SASS, LESS, etc. files in your JS files so that they get inserted as inline style tags for you.

Examples here for CSS.

Installation

$ npm install -D css-loader style-loader

Usage

  • index.js
      import css from "styles.css";
    
  • webpack.config.js
      module.exports = {
        module: {
          rules: [
            {
              test: /\.css$/i,
              use: ["style-loader", "css-loader"],
            },
          ],
        },
      };