Skip to content

Move needed require.context into an auto-written dot file and deprecate app.js #17

@KyleAMathews

Description

@KyleAMathews

Every site needs a loadContext function to create a Webpack context (Webpack doesn't let you create require contexts with variables meaning loadContext has to have a hardcoded path which means it must have a known relationship with the pages source directory.).

Right now you need an app.js file for this function. We should make that optional by auto-writing a .gatsby.js file in the root directory of a site. This would also remove a potential roadblock from people creating a Gatsby site + allow us to easily change/add to this loadContext function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssue with a clear description that the community can help with.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions