I'm trying to add the stylus-loader to support .styl files as well, i'm simply copy-pasting the sass loader object in webpack.dev.js and switching sass for stylus:
{ test: /\.styl$/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!stylus?outputStyle=expanded&sourceMap' },
and just create a copy of InfoBar.scss in stylus format as InfoBar.styl
trying to require('./InfoBar.scss') works without a problem, however if I try require('./InfoBar.styl'), webpack outputs:
[1] [require-hook] Trying to load "InfoBar.styl" as a "*.js"
and it fails with syntax error. I've tried everything from stripping down the loader definition to just the stylus loader, adding .styl to config.resolve.extensions but I can't get webpack to not load that file as JS
the issue was in part of webpack-isomorphic-tools.js, I had to register the styl extension in the style_modules
thanks @smirea ! I was having the same problem.
Most helpful comment
the issue was in part of
webpack-isomorphic-tools.js, I had to register thestylextension in thestyle_modules