Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Uglifyjs update for es6 support #249

Merged
merged 2 commits into from
Feb 19, 2018
Merged

Uglifyjs update for es6 support #249

merged 2 commits into from
Feb 19, 2018

Conversation

thetric
Copy link
Contributor

@thetric thetric commented Feb 9, 2018

No description provided.

@thetric
Copy link
Contributor Author

thetric commented Feb 9, 2018

Hm, the CI test (Node 8, npm 5.6, test suite=simple) fails because of a missing typescript dependency: See https://travis-ci.org/wmonk/create-react-app-typescript/jobs/339514110#L286

@DorianGrey
Copy link
Collaborator

Just poked it - runs now (a previous patch added a fix for this cache-related issue).
If I got that correctly, this plugin uses uglify-es under the hood, which has the ecma config option to indicate the intended ECMAScript version. And that's the one I'm not sure about.

  • The angular folks are conditionally setting this to either 5 or 6, depending on the project's typescript configuration.
  • In CRA upstream, it is always set to 8.

I'm not sure if one of these approaches has to be taken in this case as well, or if just leaving it out and thus fall back to the default ecma option in the detail config.

@thetric
Copy link
Contributor Author

thetric commented Feb 13, 2018

I think we should specify the ecma option, so it doesn't depend on the default config of uglify-es which might change.

In the case of the concrete ECMA level I'm not quite sure but I would stick to CRA's settings. This seems to be the easiest way because we can let people use whatever TS target they want and we don't need to parse the tsconfig to set the matching ecma option. uglify-es should only minify the code, not transpile or even refactor it automatically.

@thetric
Copy link
Contributor Author

thetric commented Feb 17, 2018

I updated my PR to set the ecma level to 8 (like CRA upstream).

@DorianGrey
Copy link
Collaborator

Sorry for the delay - have been quite busy the last days.

Suppose it's OK to "cherry-pick" this change from upstream before the 2.0 CRA release, since it's not yet clear when it will be released.

Thanks!

@DorianGrey DorianGrey merged commit 39d6c62 into wmonk:master Feb 19, 2018
@thetric thetric deleted the uglifyjs-update-for-es6-support branch February 22, 2018 21:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants