Skip to content

fixStyleOnlyEntries plugin can remove valid JS files from other configs #95

@kadamwhite

Description

@kadamwhite

On another project this week I observed that a multi-config Webpack setup (a webpack file exporting an array of configuration objects) in which one config has a CSS-only entry, and the other does not, can cause the valid JS file for the not-only-CSS entry to be deleted as well if both configurations include the fixStyleOnlyEntries plugin.

Removing the plugin from the config which does not include a CSS-only entry fixes the issue, but because it is significantly harder to remove a plugin from a generated Webpack configuration than it is to add a plugin to a specific configuration, we should solve this problem by removing this plugin from the presets.production factory. It will not be necessary in all builds, so the presence of unintuitive destructive behavior in some cases is worse than the inconvenience of having to include the plugin manually when consuming these helpers.

This will be a breaking change.

See #93 for fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions