Skip to content

File-loader not works with different images with same name #73

@shude

Description

@shude

Hi.
I've 2 different images with same name:

assets/images/some.png
assets/another_images/some.png

In scss file i use both. File-loader copy only first image and skips second.
I have to rewrite the rule in config-generator.js to:

{
                test: /\.(png|jpg|jpeg|gif|ico|svg)$/,
                loader: 'file-loader',
                options: {
                    name: `images/[name]_[md5:hash:hex:3]${this.webpackConfig.useVersioning ? '.[hash]' : ''}.[ext]`,
                    publicPath: this.webpackConfig.getRealPublicPath()
                }
            }

But is this a right way ?
Second question: how can i overwrite that rule in webpack.config.js ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug Fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions