bholloway/resolve-url-loader

Join Option Error

Closed this issue · 2 comments

I am trying to set up some custom processing of URLs using the join option. I am probably missing something obvious, but just doing a simple test like:

{ loader: "resolve-url-loader", options: { sourceMap: true, join: function(uri, base) { return 'test-url'; }, debug: true, } }

Returns an error "Module build failed (from ./node_modules/resolve-url-loader/index.js): Error: resolve-url-loader: CSS error join is not a function"
Any help would be appreciated.

I ran into the same issue, and managed to fix it using the following config:

{
    loader: 'resolve-url-loader',
    options: {
      root: '',
      join: (a,b) => {return (c,d) => {
        return `./${c}`
      }}
      }
  },

Essentially the join function should return a function, and that seems to work.

Thanks @quentin-dietz 🙏 . Closing as solved.

I will improve the docs in the next release.