Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using webpack specific properties decreased loader's compatibility. #1401

Closed
malash opened this issue Dec 15, 2021 · 1 comment
Closed

Using webpack specific properties decreased loader's compatibility. #1401

malash opened this issue Dec 15, 2021 · 1 comment

Comments

@malash
Copy link

malash commented Dec 15, 2021

Bug report

In the latest version of css-loader ( 6.5.1 ), there are several lines of code that used webpack specific properties in loader context, like,

loaderContext._compilation.options.devtool.includes("nosources")

and

loaderContext._compiler.webpack.util.createHash(hashFunction);

and

let result = loaderContext._compilation.getPath(localIdentName, data);

These usage cause css-loader became less compatible. For example, when using css-loader with thread-loader, the loader fails to run because of missing properties.

Actual Behavior

When using css-loader with thread-loader, this error occurred.

image

Expected Behavior

css-loader should not depends on any webpack specific properties.

How Do We Reproduce?

{
  use: [
    MiniCssExtractPlugin.loader
    'thread-loader',
    'css-loader',
  ]
}

Please paste the results of npx webpack-cli info here, and mention other relevant information

N/A

Refs

Same issue in thread-loader: webpack-contrib/thread-loader#66

Similar issue in previous: #1281

@alexander-akait
Copy link
Member

Sorry, bug in thread-loader, we can't fix it here, already tracked in thread-loader repo, anyway I recommend do not use thread-loader, it is slow down your build in most of case, prefer to use cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants