Skip to content
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

5.0.0-beta.9: JSS Dependencies Complain About "Unknown [Babel] Plugin" When Omitting include Properties in Rules #304

Closed
kohlmannj opened this issue Feb 3, 2017 · 6 comments
Labels

Comments

@kohlmannj
Copy link

I've prepared a reduced test case repo for this issue.

When using a custom Webpack config with rules that omit include properties, in particular for the JavaScript source files rule, it seems that several of Styleguidist's JSS dependencies cannot find certain Babel plugins.

Assumed workaround: add include properties to rules configs. Would be nice to omit include if possible, though.

Please let me know if there are other details I've failed to provide! Thanks!

@sapegin
Copy link
Member

sapegin commented Feb 3, 2017

There are two things:

  1. You should either include your code or exclude node_modules in your babel-loader. Otherwise you will have problems like this (see also warning about Lodash — it will just slow down your build in the best case).
  2. JSS shouldn’t publish .babelrc to npm, I’ll make an issue there.

@kohlmannj
Copy link
Author

@sapegin Thanks for the speedy reply!

Re (1): I suspect I'm misunderstanding the Webpack best practice for building projects with external non-ES5 dependencies. I'll look further into this and see what's best for my real project; thanks for confirming this problem for me.

Re (2): oh good, glad this particular issue wasn't just my babel-loader rule alone.

@sapegin
Copy link
Member

sapegin commented Feb 3, 2017

  1. If you have something that needs transpiling in node_modules it complicates config a bit ;-) I list of all this dependencies and my own code in include of babel-loader. Like this.

@sapegin
Copy link
Member

sapegin commented Feb 3, 2017

(I also highly recommend @bebraw’s book on Webpack :—)

@sapegin
Copy link
Member

sapegin commented Feb 3, 2017

JSS PR for reference: cssinjs/jss#415

@kohlmannj
Copy link
Author

Closing this issue since (1) I have obvious ideas about a workaround, really by way of config best practices (2) the JSS PR has been filed. Thanks again @sapegin, super helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants