Skip to content

Add a plugin to webpack config w/o ejecting #1060

Closed
@orditeck

Description

@orditeck

Is that possible? I'm using moment and it loads all the locales (so moment takes 200kB instead of 50kB in the build), the current fix for more than one year seems to be to exclude the locales via webpack using:

new webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(en)$/)

I tried to add it manually to /node_modules/react-scripts/config/webpack.config.prod.jsand it works but I can't do that, and I don't want to eject.

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