When I used image.styl with webpack and stylus-loader like the following code: image("./member-index-01.png", cover);, it thrown an error:
ERROR in ./~/.0.23.1@css-loader?-minimize&modules&camelCase&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]&sourceMap!./~/.0.9.1@postcss-loader?sourceMap!./~/.2.3.1@stylus-loader?sourceMap!./src/views/MemberIndex/index.styl
Module not found: Error: Can't resolve 'member-index-01@2x.png' in '/local/Coding/EasyHi/src/views/MemberIndex'
@ ./~/.0.23.1@css-loader?-minimize&modules&camelCase&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]&sourceMap!./~/.0.9.1@postcss-loader?sourceMap!./~/.2.3.1@stylus-loader?sourceMap!./src/views/MemberIndex/index.styl 6:690-723
However, when I change the code to: image("../MemberIndex/member-index-01.png", cover);, it just works! It's confusing.
Besides, I've tried the stylus-loader option preferPathResolver but it didn't work.
When I used
image.styl
withwebpack
andstylus-loader
like the following code:image("./member-index-01.png", cover);
, it thrown an error:However, when I change the code to:
image("../MemberIndex/member-index-01.png", cover);
, it just works! It's confusing.Besides, I've tried the
stylus-loader
optionpreferPathResolver
but it didn't work.