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

Lauren Schaller
Lauren Schaller
4,282 Points

Why aren't my styles being injected?

I've followed the instructions to a T and everything is compiling just fine, but my styles aren't showing up.

Here is my index.js

import loadDropDown from "./loadDropDown";
import "./styles.scss";

console.info("Hello, webpack dev server.");
loadDropDown();

and my webpack.config

var HtmlWebpackPlugin = require("html-webpack-plugin");
var path = require("path");
var webpackConfig = {
    entry: path.join(__dirname, "/src/index.js"),
    output: {
        path: path.resolve(__dirname, "build"),
        filename: "bundle.js"
    },
    module: {
        loaders: [
            {
                loader: "babel-loader",
                test: /\.js$/
            },
            {
                loaders: ["style-loader", "css-loader", "sass-loader"],
                test: /\.scss$/
            }
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: "src/index.ejs"
        })
    ]
};

module.exports = webpackConfig;