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

webpack 2.1.0-beta23+ breaks loader.options.output.path #36

Closed manofearth closed 7 years ago

manofearth commented 7 years ago

After I applied this patch: https://github.com/jtangelder/sass-loader/pull/290

I have an error

ERROR in ./~/css-loader?sourceMap!./~/resolve-url-loader!./~/sass-loader?sourceMap!./angular/app/app.style.scss
Module build failed: TypeError: Cannot read property 'path' of undefined
    at Object.resolveUrlLoader (C:\www\vast\node_modules\resolve-url-loader\index.js:38:47)

My loader config:

{
   test:    /\.(sass|scss)$/,
   loaders: ['css-to-string-loader', 'css-loader?sourceMap', 'resolve-url', 'sass-loader?sourceMap']
},

Webpack version: 2.1.0-beta.25

bholloway commented 7 years ago

I believe this is a duplicate of #33.

Refer to this workaround.

manofearth commented 7 years ago

Thank you for workaround, it helped. But I think this is a problem, and it makes sense to leave this issue opened.

vladimiry commented 7 years ago

Doesn't look for me as duplicate since that issue is closed with no proper fix implemented.

It's not recommended to use webpack.LoaderOptionsPlugin thing (Webpack 2 supports loader.options as an object, not like before when query was always a string), a bad practice, but it's helpful for a gradual transition to Webpack 2.

So using LoaderOptionsPlugin is a workaround, a temporary solution, proper fix would imply a Webpack 2 support. So please keep this issue opened.

bholloway commented 7 years ago

@manofearth @vladimiry could you please let me know if #45 will fix your issue.

Use npm i resolve-url-loader@bholloway/resolve-url-loader#feature/support-sass-loader-6