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

resolve-url-loader corrupts sourcemap for root file. #141

Closed syberon closed 4 years ago

syberon commented 4 years ago

For example, if we have the same structure:

css/
   main.scss
   include.scss

content of include.scss:

.include-test-style {
  color: #00cc00;
}

content of main.scss:

@import './include.scss'

.test-style {
  color: #cc0000;
}

If i process this files without resolve-url-loader in development mode i get correct source maps in output for both files (all lines numbers matches with source css code in sourcemaps).

Bot if i add resolve-url-loader to loaders chain i get correct sourcemap for file include.scss (all lines numbers matches with source css code in sourcemaps) but css content for root file main.scss transforms to processed css (with processes all imports). Line numbers of source code matches with source file, but content became already processed.

syberon commented 4 years ago

Ouch!

The problem was in another loader in the chain.