FormulaMonks / FormulaMonks/thicket

Add minify step with build process

Open
#40 1 comment 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
JavaScript
Stars
27
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Ref: [here](https://github.com/citrusbyte/thicket/pull/36#issuecomment-336845037)

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](https://github.com/ipld/js-cid/issues/38). Seems their library checks against `class` names. `minify` libraries overwrite class names thus the check fails.
- Tried using [`uglify 3`](https://github.com/webpack-contrib/uglifyjs-webpack-plugin) 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`](https://babeljs.io/blog/2016/08/30/babili) with the `keepFnNames` & `keepClassName` params and it did not work either.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.