Skip to content

Potential global CSS recipe inaccuracy #23236

@Js-Brecht

Description

@Js-Brecht

I am curious about something that stuck out as kind of odd to me.

In the directions for the Using global CSS files without a Layout component recipe, it says:

Note: You can also make use of require('./src/styles/global.css') to import the global CSS file in your gatsby-config.js file.

AFAIK, gatsby-config is not processed by Webpack. Saying that you can require() your CSS in gatsby-config is misleading, and will actually cause the build to fail since CSS is generally not CommonJS.

Please correct me if I'm wrong. I didn't want to alter it without first determining if I had misunderstood the run path, or if maybe this bit was meant to convey something different than what it currently does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: documentationAn issue or pull request for improving or updating Gatsby's documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions