-
-
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
components not parsed by babel #736
Comments
What issues you have with the current approach? It’s handled by react-docgen and it only works with the source code. |
Well, I can't do any pre-compilation on my source files - in example svg -> js conversion. Transformed files could be stringified and passed to the |
Have you tested that your transpiled code actually works with react-docgen?
Sure, it may be a good idea. |
Yeah, I've worked around the issue with: "icons": "babel src/components/Icons -x \".svg\" --out-dir src/components/Icons --no-babelrc --plugins react-svg,syntax-jsx",
"styleguide": "npm run icons && cross-env BABEL_ENV=es NODE_ENV=development styleguidist server", and it works fine, but would be better to include this in more standard build pipeline - directly in styleguidist/webpack/babel configs instead of making an additional ninja script ;) |
We can add a config option like |
@sapegin this would be really useful as I could use this transformer solution to handle a different use case:
I need the transform to strip types and transpile it to ES6 before loading the source, otherwise it will have syntax errors. |
@piotrwitek This issue is about transforming source code, not examples. I think you’re talking about #462. |
@sapegin now I got it (after reading development section), thanks and sorry for the noise |
That would certainly make a better integration point. |
@Andarist A pull request would make it much sooner ;-) |
Sure thing, I'm willing to do this - just having many open PRs/ideas right now, so if anyone wants to do that before I get to it (eventually) feel free to do so! |
I’m closing this for now. Feel free to submit a pull request if you need this. |
So my intention is to transpile svg with babel and from what I can see you try to parse components found with a pattern on your own and deduce from the output if the file exports a React Component. It would be great to load components files first with other webpack loaders and then decide if its exporting a React component.
styleguide.config.js
).latest
The text was updated successfully, but these errors were encountered: