carteb / carte-blanche

An isolated development space with integrated fuzz testing for your components. See them individually, explore them in different states and quickly and confidently develop them.
https://www.youtube.com/watch?v=6g3-TQ6aaw8
MIT License
1.5k stars 47 forks source link

Add CommonsChunkPlugin support #285

Closed FezVrasta closed 8 years ago

FezVrasta commented 8 years ago

I'm using react-boilerplate, when I add carte-blanche and I visit /carte-blanche I get

Uncaught ReferenceError: webpackJsonp is not defined

How can I fix it?

mxstbr commented 8 years ago

That's because react-boilerplate uses the CommonsChunkPlugin. Use the injectTags option of the ReactPlugin to inject <script src="common.js.js"></script> (yeah, that .js.js is a bug…) and it should work!

FezVrasta commented 8 years ago

Like this?

    new CarteBlanche({
      componentRoot: './app/components',
      plugins: [
        new ReactPlugin({ injectTags: ['<script src="common.js.js"></script>'] }),
      ],
    }),

If so, it still doesn't work... actually it doesn't add the script tag.

FezVrasta commented 8 years ago

I just noticed that ReactPlugin injects the tag in the iframes, the problem is that the error is thrown by the Carte Blanche bundle, not by the components.

The page just doesn't load at all.

mxstbr commented 8 years ago

Ah, damn, that's a problem! Will look into it, we might have to add an injectTags options to the main CarteBlanche plugin.

eddiewang commented 8 years ago

I'm getting this error as well. What would be the best way to approach this issue?

mxstbr commented 8 years ago

Not yet fixed, we're on it!

eddiewang commented 8 years ago

Awesome - thanks. FYI I'm using: https://github.com/rangle/react-redux-starter

mxstbr commented 8 years ago

Done with v0.2! :tada:

Now onwards to try with react-boilerplate again…

FezVrasta commented 8 years ago

Are you going to release 0.2 anytime soon? Thanks

mxstbr commented 8 years ago

It's released! I wouldn't have closed this issue otherwise. :grin:

It doesn't work with react-boilerplate, still investigating about that but we're almost there, it's rendering already!

FezVrasta commented 8 years ago

Oh sorry I thought you would have added a release on GitHub.

mxstbr commented 8 years ago

Ah, forgot to push the tag, my bad! Thanks for reminding me, it'll be right there…

EDIT: The release is now on Github too, thanks again!

NickMalt commented 8 years ago

Is it work with react-boilerplate now?