-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Styleguidist not working with npm 2 (error in make-webpack-config.js) #131
Comments
But do we actually need to support npm 2? As a quick fix we could try to replace [
getPackagePath('entities'),
getPackagePath('markdown-it')
] |
Yes, because of Node 4.x LTS releases. They are pretty new and they still use npm 2. And your quick fix will not work, because I'm actually surprised that Webpack doesn't support json by default. On the other hand, it would be nice if For the time being, I propose to just change these lines like so:
I wouldn't use |
Looks good for me. |
On the other hand, we already force users to use ES6+JSX in examples, with Lodash 4 and React 15. Anyone using other versions of these libraries, or other Babel config will have problems with writing practical examples. I think that this is more important then avoiding enabling the json loader for user files. ;) As for the fix - I'll make a PR. But I've seen this:
Shall I add |
But there’s no easy fix if it’s possible to fix at all.
Yeah, I think so. |
@mik01aj, error when i use 2.2.1 and npm 3.8.6 |
Yes, this was already reported in #135. |
The problem is here: https://github.com/sapegin/react-styleguidist/blob/3a7271fc59ada1bcb959d62d174d64fecdc69645/src/make-webpack-config.js#L73
getPackagePath('entities')
breaks, becauseentities
is not a dependency of styleguidist.entities
is a dependency ofmarkdown-it
, which is a dependency of styleguidist, so:entities
module is not accessible from styleguidist,entities
module is not guaranteed to be always accessible from styleguidist (because if some of other dependencies starts depending on another version ofentities
package, npm 3 will nest them).@sapegin, could you explain why is the json loader needed there?
Maybe we could change the regex to target specifically these files? Or the other way round, enable it for any
*.json
files?The text was updated successfully, but these errors were encountered: