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

dist build is broken? #53

Open
sherbondy opened this issue Apr 3, 2018 · 0 comments
Open

dist build is broken? #53

sherbondy opened this issue Apr 3, 2018 · 0 comments

Comments

@sherbondy
Copy link

sherbondy commented Apr 3, 2018

Hi there,

I am trying to use the dist build of the swipeout component, but it seems like the build is broken!

Here's a minimal example in a codepen:

https://codepen.io/sherbondy/pen/jzKKrz?editors=1111

As you can see, both React and ReactDOM are available on the global window object, but the swipeout dist script is assigning an empty JavaScript object to window["rc-swipeout"].

Any idea what might be amiss?

I tried forking the repository and fiddling with the config in the package.json file.

I initially thought it might be a quirk with an older webpack version, so I tried bumping the rc-tools dependency to v7, but no go!

I also experimented with changing the config.output.libraryTarget setting, e.g. to be window instead of umd, but that causes the library to throw an error on import:

Uncaught TypeError: Cannot read property 'Component' of undefined

I'm a little out of my depth here, so if anyone has any pointers or ideas, re: what might be messing up the dist build, I would love to hear your advice!

Also, just an ergonomic thing, I think it'd be nicer if the config.output.library setting was changed to, e.g. Swipeout so you could call window.Swipeout instead of using the more awkward window["rc-swipeout"] syntax (due to the dash in the name).

Thanks!

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

No branches or pull requests

1 participant