2

I am using mono repo with npm workspaces. Repo has 3 packages

  1. server - server code
  2. commons - common code shared between server and ionic-app
  3. ionic-app - ionic app

Both server and commons app are configured with target of ‘ES2020’ as follows.

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "commonjs",
    "lib": ["ES2020"],
  }
}

But ionic react app which uses commons package has target of ‘es5’. To match with commons tsconfig, if I change target of ionic app to “ES2020” and module to ‘commonjs’, will there be any compatibility issue while running app in mobile platform (especially older mobile)?

Pavan Kumar
  • 1,715
  • 1
  • 24
  • 48

1 Answers1

0

I did tried to use the es2020 instead of es5 and couldn't find any error.

Also, when running ng update to the angular v14, it will change it automatically to this version.

So for me it's safe to be use.

Compatibility issue

Ionic is meant to be used by older smartphone, the newest ECMAScript version (the 2020) does contains some logics that does not work on every devices (specific the older one).

Please, have a look here: https://kangax.github.io/compat-table/es2016plus/ and scroll down to the 2020 features.

Raphaël Balet
  • 6,334
  • 6
  • 41
  • 78