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

Add minify step with build process #40

Open
AquiGorka opened this issue Oct 16, 2017 · 1 comment
Open

Add minify step with build process #40

AquiGorka opened this issue Oct 16, 2017 · 1 comment

Comments

@AquiGorka
Copy link
Contributor

AquiGorka commented Oct 16, 2017

Ref: here

In order to run yarn build successfully we needed to remove the minify step from the build process. We need to be able to integrate it back to minify our code deployed to production.

tldr;

  • create-react-app uses uglify 2 and some of our dependencies (mostly from IPFS) where throwing an error when minifying (their codebase is built with es6 syntax and uglify 2 is not able to understand it).
  • By transpiling their code base before minifying we hoped the process would succeed, and it did, but another error popped up. This error is referenced here. Seems their library checks against class names. minify libraries overwrite class names thus the check fails.
  • Tried using uglify 3 since it understands es6 syntax but the name checking error still renders and the app does not work. Even with the keep_fnames: true and keep_classnames configuration params the app fails (the error is no longer about the classname but another one: Uncaught SyntaxError: Unexpected token ().
  • Tried using babili with the keepFnNames & keepClassName params and it did not work either.
@AquiGorka AquiGorka changed the title Fix minify step with build process Add minify step with build process Oct 16, 2017
@AquiGorka
Copy link
Contributor Author

Maybe there is a reason why the IPFS team uses Aegir. This might help out anyone working on this issue in the future.

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

No branches or pull requests

1 participant