Skip to content

Imported css file returns undefined #331

@mattoni

Description

@mattoni

I'm working with the static website generator plugin (https://github.com/markdalgleish/static-site-generator-webpack-plugin) and React. Normally I don't have any problem with this but I can't figure out what's happening this time.

I've got the following loaders :

            { test: /\.css$/, loader: ExtractTextPlugin.extract("style-loader", "css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]") },
            { test: /\.scss$/, loader: ExtractTextPlugin.extract("style-loader", "css?modules&importLoaders=1&localIdentName=[path]___[name]__[local]___[hash:base64:5]!sass") },

and of course the plugin:

    plugins: [
        new ExtractTextPlugin("css/[name].css"),

in my webpack config. This generates the files correctly. However, when the static website plugin does its thing to generate the HTML:

import styles from "./styles.scss";

console.log(styles);

styles ends up being undefined, despite having generated the correct files.

Am I missing something here? Can provide more info if needed.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions