React-styleguidist: 5.0.0-rc.1 (or earlier): need Webpack config `externals` support

Created on 16 Mar 2017  ·  7Comments  ·  Source: styleguidist/react-styleguidist

The Problem

In short, losing support for externals in the Webpack config passed to Styleguidist is a blocker, and would potentially keep our internal style guide dependent on rsg v5.0.0-beta.13.

At least one of our components depends on a library which:

  • We can't directly install via NPM or subsequently bundle with Webpack
  • Expects to be loaded onto a page either via a <script> tag or RequireJS
  • Depends on jQuery, which must also be loaded via a <script> tag or RequireJS

Passing externals through to Styleguidist, plus a modified HTML template, has worked around these limitations in the past. Unfortunately, this workaround is no longer possible in v5.0.0-rc.1. It _did_ work as recently as react-styleguidist v5.0.0-beta.13, however.

Your style guide config (styleguide.config.js).

Please refer to the Reproducible Demo project (direct link to its styleguide.config.js).

Testing Environment

  • Webpack version: 2.2.1
  • Operating system: macOS Sierra 10.12.3
  • react-styleguidist v5.0.0-rc.1
  • Node v7.6.0
  • NPM v4.1.2

Reproducible Demo

kohlmannj/styleguidist-5.0.0-rc.1_externals-example

Thank you!

Most helpful comment

Let’s keep this issue open — I may do it before the final release ;-)

All 7 comments

You can still use updateWebpackConfig option — it has no restrictions. It’s marked as deprecated because we want to know all use cases where other options are not enough and encourage users to migrate to new options.

We may rename it to dangerouslyUpdateWebpackConfig and remove deprecation message 💀

@sapegin I see…turns out I had (quite happily) migrated away from updateWebpackConfig in that very spirit! If this is the only envisioned mechanism by which externals would work in the future, I'd appreciate dangerously over deprecation.

I think removing externals by default is the desired behavior in the most use cases. But I may be wrong ;-)

@sapegin Yup, I agree! My main concern is that there's a way to do this at all, long-term. Again, that seems to be a 👎🏼 on entirely deprecating updateWebpackConfig.

Let’s keep this issue open — I may do it before the final release ;-)

Out in [email protected] ;-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stcherenkov picture stcherenkov  ·  3Comments

crobinson42 picture crobinson42  ·  3Comments

dzimmerman902 picture dzimmerman902  ·  3Comments

mheathcote1977 picture mheathcote1977  ·  3Comments

gscottolson picture gscottolson  ·  3Comments