catamphetamine / webpack-isomorphic-tools

Server-side rendering for your Webpack-built applications (e.g. React)
MIT License
1.25k stars 48 forks source link

Webpack_isomorphic_tools_plugin.style_loader_filter isn't compatible with latest-version npm #102

Closed dayzhou closed 8 years ago

dayzhou commented 8 years ago

Your style_loader_filter() use predicates like: (css_loader.indexOf('/~/css-loader') > 0 || css_loader.indexOf('/~/.npminstall/css-loader') > 0 || css_loader.indexOf('/~/.store/css-loader') > 0)

However, new versions of npm install modules in hidden directories which look a bit like: ./~/.0.23.1@css-loader...

So I have to write my own style_loader_filter() to correct this imcompatibility.

dayzhou commented 8 years ago

Sorry, that's not an issue actually, or I would say it's a "regional" issue.

Since I'm in China where npm doesn't work well, I use cnpm instead. cnpm saves modules in directories like ./~/.0.23.1@css-loader and makes symlinks to these directories so as to avoid deep nesting dependencies. It turns out it was this weird asset that renders Webpack_isomorphic_tools_plugin.style_loader_filter invalid. As a walkaround, I write my own predicate: /\/~\/.*css-loader/.test(css_loader) to replace the css_loader.indexOf thing.

I make a comment here just in case my Chinese folks come across this same issue :)

catamphetamine commented 8 years ago

I'm in China where npm doesn't work well

Wow, so China, much firewall

I make a comment here just in case my Chinese folks come across this same issue

:thumbsup: