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

Uglifyjs and Uppy #230

Closed
payner35 opened this issue Jun 23, 2017 · 12 comments
Closed

Uglifyjs and Uppy #230

payner35 opened this issue Jun 23, 2017 · 12 comments

Comments

@payner35
Copy link

Meteor.js uses https://atmospherejs.com/meteor/standard-minifier-js to create the production build for deployment to a server.

This uses Uglifyjs. I have some productions build issues and I'm pretty sure it's Uppy. (works great in testing env)

I'm not very familiar with uglify but a test has shown the following

image

any thoughts on this? Can uppy be packaged by Uglify?

@kvz
Copy link
Member

kvz commented Jun 23, 2017

It appears it does not understand ES6, seems like you either need to add ES6 support to Uglify, or point it to the ES5 transpiled files vs the ES6 sources?

@goto-bus-stop
Copy link
Contributor

Yep, make sure to use the files from Uppy's lib/ folder—they work with uglify (and are also a bit faster).

@payner35
Copy link
Author

the lib folder has dropped off the repo?

just the scr now

@goto-bus-stop
Copy link
Contributor

The lib/ folder is part of the npm package.

@payner35
Copy link
Author

so ive been looking into this for a day or so.. and have created 2 packages that work in dev mode (meteor). But still, run into issues when deployed to production. The minification process just hangs

I'm pretty sure the issue is with Uppy. https://github.com/payner35/uppy (maybe there are still some es6 references left here?)

https://github.com/payner35/tus-js-client is working as expected.

@kvz
Copy link
Member

kvz commented Jun 23, 2017

What error are you getting now? Still about const? Can we see it? How are you pointing to the lib folder?

@payner35
Copy link
Author

ok.. i think I have tracked down the issue. its with

Uppy/lib/plugins/Transloadit/Socket.js

which imports packages socket.io --> engine.io --> ws

ws does not compile with uglify-js and is causing the hang

Any work around?

@arturi
Copy link
Contributor

arturi commented Jun 23, 2017

https://www.npmjs.com/package/ws

Note: This module does not work in the browser. The client in the docs is a reference to a back end with the role of a client in the WebSocket communication. Browser clients must use the native WebSocket object.

So I wonder if it should be in the bundle at all.

@goto-bus-stop
Copy link
Contributor

goto-bus-stop commented Jun 23, 2017 via email

@payner35
Copy link
Author

yeah.. meteor does have a current issue with the 'browser' field it seems (for now)

Engine.io does indeed have the code that Meteor will ignore
image

What i have noticed is if I simply delete ws from my node_modules folder..

I can deploy/minify.. and the app works as expected. (with the 2 packages i forked above) I can upload via uppy --> transloadit

So all seems doable for us Meteor folk now.

@kvz
Copy link
Member

kvz commented Jun 23, 2017

So all seems doable for us Meteor folk now.

Thanks so much for persevering @payner35, I realize this was a bit rough, but it's is going to help other Meteor users greatly for sure!

@payner35
Copy link
Author

no worries. good to have it working ;)

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

4 participants