Skip to content

Add method to disable warning about Encore.configureLoaderRule() #886

@hailwood

Description

@hailwood

When adding svgr we need to alter the image rule.
We could either disable the image rule all together, or the less fragile option is to just remove svg from the test.

Encore.configureLoaderRule("images", (loaderRule) => {
  loaderRule.test = new RegExp(loaderRule.test.toString().replace('|svg', ''));
});

This triggers a warning

Be careful when using Encore.configureLoaderRule(), this is a low-level method that can potentially break Encore and Webpack when not used carefully.

I'd like a way to disable that warning, an explicit opt-in to say "I know what I'm doing can break it, but please don't want me every time".

Something like

Encore.disableLowLevelApiWarnings();

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