{"action":"created","issue":{"url":"https://api.github.com/repos/webpack-contrib/css-loader/issues/571","repository_url":"https://api.github.com/repos/webpack-contrib/css-loader","labels_url":"https://api.github.com/repos/webpack-contrib/css-loader/issues/571/labels{/name}","comments_url":"https://api.github.com/repos/webpack-contrib/css-loader/issues/571/comments","events_url":"https://api.github.com/repos/webpack-contrib/css-loader/issues/571/events","html_url":"https://github.com/webpack-contrib/css-loader/issues/571","id":241419527,"number":571,"title":"Using webpack resolve.alias ","user":{"login":"Tux1","id":6661307,"avatar_url":"https://avatars2.githubusercontent.com/u/6661307?v=4","gravatar_id":"","url":"https://api.github.com/users/Tux1","html_url":"https://github.com/Tux1","followers_url":"https://api.github.com/users/Tux1/followers","following_url":"https://api.github.com/users/Tux1/following{/other_user}","gists_url":"https://api.github.com/users/Tux1/gists{/gist_id}","starred_url":"https://api.github.com/users/Tux1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tux1/subscriptions","organizations_url":"https://api.github.com/users/Tux1/orgs","repos_url":"https://api.github.com/users/Tux1/repos","events_url":"https://api.github.com/users/Tux1/events{/privacy}","received_events_url":"https://api.github.com/users/Tux1/received_events","type":"User","site_admin":false},"labels":[{"id":595332630,"url":"https://api.github.com/repos/webpack-contrib/css-loader/labels/priority:%205%20(nice%20to%20have)","name":"priority: 5 (nice to have)","color":"bfdadc","default":false},{"id":595332641,"url":"https://api.github.com/repos/webpack-contrib/css-loader/labels/semver:%20Minor","name":"semver: Minor","color":"006b75","default":false},{"id":595332610,"url":"https://api.github.com/repos/webpack-contrib/css-loader/labels/type:%20Feature","name":"type: Feature","color":"65ABFF","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-07-08T02:46:59Z","updated_at":"2018-04-13T10:44:48Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\ncss-loader doesn't manage to resolve some file from path using webpack resolve.alias.\r\nI saw that there is an option to create css-loader aliases with `alias` option. But is it possible to use directly webpack resolve.alias ? \r\nIt was perfectly working with webpack 1 and `css-loader` `0.26.0` but since I have updated my packages, it is broken.\r\n\r\n```\r\n.topbar-logo {\r\n  width: 64px;\r\n  height: 64px;\r\n  background-image: url(~assets/images/logo.svg);\r\n}\r\n\r\n```\r\n\r\nWebpack config:\r\n```\r\n{\r\n  resolve: {\r\n    alias: {\r\n      pages: path.resolve(__dirname, 'src/pages'),\r\n      components: path.resolve(__dirname, 'src/components'),\r\n      constants: path.resolve(__dirname, 'src/constants'),\r\n      actions: path.resolve(__dirname, 'src/actions'),\r\n      reducers: path.resolve(__dirname, 'src/reducers'),\r\n      utils: path.resolve(__dirname, 'src/utils'),\r\n      assets: path.resolve(__dirname, 'src/assets'),\r\n      scss: path.resolve(__dirname, 'src/assets/scss'),\r\n    },\r\n    extensions: ['.js', '.jsx', '.json'],\r\n    modules: [\r\n      path.resolve(__dirname, 'src'),\r\n      path.resolve(__dirname, 'node_modules'),\r\n    ],\r\n  },\r\n}\r\n```\r\n\r\nLog :\r\n\r\n> ERROR in ./node_modules/css-loader?{\"sourceMap\":true,\"localIdentName\":\"[name]_[local]_[hash:base64:3]\",\"modules\":true,\"minimize\":false}!./node_modules/sass-loader/lib/loader.js!./src/components/SideBar/styles.scss\r\n> Module not found: Error: Can't resolve '~assets/images/logo.svg' in '/Users/toto1/MEGA/myProject/web/src/components/SideBar'\r\n> resolve '~assets/images/logo.svg' in '/Users/toto1/MEGA/myProject/web/src/components/SideBar'\r\n>   Parsed request is a module\r\n>   using description file: /Users/toto1/MEGA/myProject/web/package.json (relative path: ./src/components/SideBar)\r\n>     Field 'browser' doesn't contain a valid alias configuration\r\n>   after using description file: /Users/toto1/MEGA/myProject/web/package.json (relative path: ./src/components/SideBar)\r\n>     resolve as module\r\n>       looking for modules in /Users/toto1/MEGA/myProject/web/src\r\n>         using description file: /Users/toto1/MEGA/myProject/web/package.json (relative path: ./src)\r\n>           Field 'browser' doesn't contain a valid alias configuration\r\n>         after using description file: /Users/toto1/MEGA/myProject/web/package.json (relative path: ./src)\r\n>           using description file: /Users/toto1/MEGA/myProject/web/package.json (relative path: ./src/~assets/images/logo.svg)\r\n>             no extension\r\n>               Field 'browser' doesn't contain a valid alias configuration\r\n>               /Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg doesn't exist\r\n>             .js\r\n>               Field 'browser' doesn't contain a valid alias configuration\r\n>               /Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg.js doesn't exist\r\n>             .jsx\r\n>               Field 'browser' doesn't contain a valid alias configuration\r\n>               /Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg.jsx doesn't exist\r\n>             .json\r\n>               Field 'browser' doesn't contain a valid alias configuration\r\n>               /Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg.json doesn't exist\r\n>             as directory\r\n>               /Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg doesn't exist\r\n>       looking for modules in /Users/toto1/MEGA/myProject/web/node_modules\r\n>         using description file: /Users/toto1/MEGA/myProject/web/package.json (relative path: ./node_modules)\r\n>           Field 'browser' doesn't contain a valid alias configuration\r\n>         after using description file: /Users/toto1/MEGA/myProject/web/package.json (relative path: ./node_modules)\r\n>           using description file: /Users/toto1/MEGA/myProject/web/package.json (relative path: ./node_modules/~assets/images/logo.svg)\r\n>             no extension\r\n>               Field 'browser' doesn't contain a valid alias configuration\r\n>               /Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg doesn't exist\r\n>             .js\r\n>               Field 'browser' doesn't contain a valid alias configuration\r\n>               /Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg.js doesn't exist\r\n>             .jsx\r\n>               Field 'browser' doesn't contain a valid alias configuration\r\n>               /Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg.jsx doesn't exist\r\n>             .json\r\n>               Field 'browser' doesn't contain a valid alias configuration\r\n>               /Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg.json doesn't exist\r\n>             as directory\r\n>               /Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg doesn't exist\r\n> [/Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg]\r\n> [/Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg.js]\r\n> [/Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg.jsx]\r\n> [/Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg.json]\r\n> [/Users/toto1/MEGA/myProject/web/src/~assets/images/logo.svg]\r\n> [/Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg]\r\n> [/Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg.js]\r\n> [/Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg.jsx]\r\n> [/Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg.json]\r\n> [/Users/toto1/MEGA/myProject/web/node_modules/~assets/images/logo.svg]\r\n>  @ ./node_modules/css-loader?{\"sourceMap\":true,\"localIdentName\":\"[name]_[local]_[hash:base64:3]\",\"modules\":true,\"minimize\":false}!./node_modules/sass-loader/lib/loader.js!./src/components/SideBar/styles.scss 6:92384-92418\r\n>  @ ./src/components/SideBar/styles.scss\r\n>  @ ./src/components/SideBar/index.jsx\r\n>  @ ./src/components/App/index.jsx\r\n>  @ ./src/utils/routes.jsx\r\n>  @ ./src/main.jsx\r\n>  @ multi react-hot-loader/patch webpack-hot-middleware/client ./main.jsx\r\n\r\nThanks !"},"comment":{"url":"https://api.github.com/repos/webpack-contrib/css-loader/issues/comments/381098064","html_url":"https://github.com/webpack-contrib/css-loader/issues/571#issuecomment-381098064","issue_url":"https://api.github.com/repos/webpack-contrib/css-loader/issues/571","id":381098064,"user":{"login":"Oscar-ren","id":9464221,"avatar_url":"https://avatars2.githubusercontent.com/u/9464221?v=4","gravatar_id":"","url":"https://api.github.com/users/Oscar-ren","html_url":"https://github.com/Oscar-ren","followers_url":"https://api.github.com/users/Oscar-ren/followers","following_url":"https://api.github.com/users/Oscar-ren/following{/other_user}","gists_url":"https://api.github.com/users/Oscar-ren/gists{/gist_id}","starred_url":"https://api.github.com/users/Oscar-ren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Oscar-ren/subscriptions","organizations_url":"https://api.github.com/users/Oscar-ren/orgs","repos_url":"https://api.github.com/users/Oscar-ren/repos","events_url":"https://api.github.com/users/Oscar-ren/events{/privacy}","received_events_url":"https://api.github.com/users/Oscar-ren/received_events","type":"User","site_admin":false},"created_at":"2018-04-13T10:44:48Z","updated_at":"2018-04-13T10:44:48Z","author_association":"NONE","body":"looks like you used css module, delete ~ will ok"}}
{"actor":{"display_login":"Oscar-ren"}}