{"action":"created","issue":{"url":"https://api.github.com/repos/webpack/webpack/issues/7619","repository_url":"https://api.github.com/repos/webpack/webpack","labels_url":"https://api.github.com/repos/webpack/webpack/issues/7619/labels{/name}","comments_url":"https://api.github.com/repos/webpack/webpack/issues/7619/comments","events_url":"https://api.github.com/repos/webpack/webpack/issues/7619/events","html_url":"https://github.com/webpack/webpack/issues/7619","id":336535641,"node_id":"MDU6SXNzdWUzMzY1MzU2NDE=","number":7619,"title":"css-loader generate different [hash:base64:5] hash when i used LoaderOptionsPlugin ","user":{"login":"MrKou47","id":13513747,"node_id":"MDQ6VXNlcjEzNTEzNzQ3","avatar_url":"https://avatars2.githubusercontent.com/u/13513747?v=4","gravatar_id":"","url":"https://api.github.com/users/MrKou47","html_url":"https://github.com/MrKou47","followers_url":"https://api.github.com/users/MrKou47/followers","following_url":"https://api.github.com/users/MrKou47/following{/other_user}","gists_url":"https://api.github.com/users/MrKou47/gists{/gist_id}","starred_url":"https://api.github.com/users/MrKou47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrKou47/subscriptions","organizations_url":"https://api.github.com/users/MrKou47/orgs","repos_url":"https://api.github.com/users/MrKou47/repos","events_url":"https://api.github.com/users/MrKou47/events{/privacy}","received_events_url":"https://api.github.com/users/MrKou47/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-28T09:06:09Z","updated_at":"2018-06-28T15:19:11Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!-- Please don't delete this template because we'll close your issue -->\r\n<!-- Before creating an issue please make sure you are using the latest version of webpack. -->\r\n\r\n# Bug report\r\n\r\n<!-- Please ask questions on StackOverflow or the webpack Gitter. -->\r\n<!-- https://stackoverflow.com/questions/ask?tags=webpack -->\r\n<!-- https://gitter.im/webpack/webpack -->\r\n<!-- Issues which contain questions or support requests will be closed. -->\r\n\r\n**What is the current behavior?**\r\n\r\ni have clientEntry and serverEntry for build the universal react app, both these entryConfig use `css-loader`, but only clientEntry used `LoaderOptionsPlugin` and `transform-loader`.\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\nI read the source code and find that css-loader used [interpolateName#L36](https://github.com/webpack/loader-utils/blob/master/lib/interpolateName.js#L36) to generate `localIdentName` hash. But when i used `LoaderOptionsPlugin` with `options` property, the css-loader generate different cssName with different hash. I add the breakpoint in the `interpolateName` function and find that has different context, so i guess that `LoaderOptionsPlugin` set `conetxt` to `undefined`, and then webpack generate a new context to cover that context.\r\n\r\nI think that should we ignore the `key` if `key === context` or `context === undefined` [LoaderOptionsPlugin.js#L44](https://github.com/webpack/webpack/blob/master/lib/LoaderOptionsPlugin.js#L44), for avoid rewrite context key?\r\n\r\n[gist](https://gist.github.com/MrKou47/d5ba3e38b6f69deedc9b67ea7350973c#file-css-loader-with-optionplugin-js)\r\n\r\n<!-- A great way to do this is to provide your configuration via a GitHub repository -->\r\n<!-- The most helpful is a minimal reproduction with instructions on how to reproduce -->\r\n<!-- Repositories with too many files or large `webpack.config.js` files are not suitable -->\r\n<!-- Please only add small code snippets directly into this issue -->\r\n<!-- https://gist.github.com is a good place for longer code snippets -->\r\n<!-- If your issue is caused by a plugin or loader, please create an issue on the loader/plugin repository instead -->\r\n\r\n**What is the expected behavior?**\r\n\r\nGenerate the same hash.\r\n\r\n<!-- \"It should work\" is not a helpful explanation -->\r\n<!-- Explain exactly how it should behave -->\r\n\r\n**Other relevant information:**\r\nwebpack version:  3.11.0\r\nNode.js version: 9.11.1\r\nOperating System:  osx\r\nAdditional tools: \r\n"},"comment":{"url":"https://api.github.com/repos/webpack/webpack/issues/comments/401071684","html_url":"https://github.com/webpack/webpack/issues/7619#issuecomment-401071684","issue_url":"https://api.github.com/repos/webpack/webpack/issues/7619","id":401071684,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTA3MTY4NA==","user":{"login":"sokra","id":1365881,"node_id":"MDQ6VXNlcjEzNjU4ODE=","avatar_url":"https://avatars0.githubusercontent.com/u/1365881?v=4","gravatar_id":"","url":"https://api.github.com/users/sokra","html_url":"https://github.com/sokra","followers_url":"https://api.github.com/users/sokra/followers","following_url":"https://api.github.com/users/sokra/following{/other_user}","gists_url":"https://api.github.com/users/sokra/gists{/gist_id}","starred_url":"https://api.github.com/users/sokra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sokra/subscriptions","organizations_url":"https://api.github.com/users/sokra/orgs","repos_url":"https://api.github.com/users/sokra/repos","events_url":"https://api.github.com/users/sokra/events{/privacy}","received_events_url":"https://api.github.com/users/sokra/received_events","type":"User","site_admin":false},"created_at":"2018-06-28T15:19:11Z","updated_at":"2018-06-28T15:19:11Z","author_association":"MEMBER","body":"Pass a `context` to the LoaderOptionsPlugin. It's only for backward-compatibility."}}
{"actor":{"display_login":"sokra"}}