React-redux-universal-hot-example: Webpack not detecting stylus loader/files

Created on 6 Dec 2015  路  2Comments  路  Source: erikras/react-redux-universal-hot-example

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

Most helpful comment

the issue was in part of webpack-isomorphic-tools.js, I had to register the styl extension in the style_modules

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jorgehmv picture jorgehmv  路  3Comments

yesmeck picture yesmeck  路  3Comments

sauravskumar picture sauravskumar  路  6Comments

ansonla3 picture ansonla3  路  4Comments

skywickenden picture skywickenden  路  4Comments