bholloway / resolve-url-loader

Webpack loader that resolves relative paths in url() statements based on the original source file
563 stars 71 forks source link

[v4]: Is it possible to set filename [name].[ext] instead of [hash][ext] #213

Closed rkovalov closed 2 years ago

rkovalov commented 2 years ago

Before I used v3 with file-loader for resolving paths and naming, But with webpack v5 this tandem doest work

{
        test: /\.(woff|eot|ttf|woff2|otf)$/,
        use: [
          {
            loader: "file-loader",
            options: {
              name: "./fonts/[name].[ext]",
              // esModule must be false for properly resolve url by resolve-url-loader
              esModule: false,
            },
          },
        ],
 }
bholloway commented 2 years ago

Here we are dealing only with the asset source files. The final emitted files has nothing to do with resolve-url-loader.

However I think you are on the right track looking at file-loader.

I am closing for now since I cannot help further. Feel free to comment further. I will reopen as necessary.