From 8fbec4954a8287e96f13d0d9cbad7950c9c834b7 Mon Sep 17 00:00:00 2001 From: Jarda Snajdr Date: Mon, 2 Nov 2020 20:26:34 +0100 Subject: [PATCH] Configure ES5 transpilation correctly --- packages/language-picker/package.json | 3 ++- packages/language-picker/tsconfig.json | 7 +++++-- packages/search/package.json | 3 ++- packages/search/tsconfig.json | 7 +++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/language-picker/package.json b/packages/language-picker/package.json index f5f08d0d6e4bb..0d45000371c4b 100644 --- a/packages/language-picker/package.json +++ b/packages/language-picker/package.json @@ -32,7 +32,8 @@ "@babel/runtime": "^7.11.1", "@wordpress/base-styles": "^2.0.1", "@wordpress/components": "^10.0.5", - "@wordpress/i18n": "^3.14.0" + "@wordpress/i18n": "^3.14.0", + "tslib": "^1.10.0" }, "peerDependencies": { "react": "^16.8", diff --git a/packages/language-picker/tsconfig.json b/packages/language-picker/tsconfig.json index a1f79ccc20a3e..9f9b0cc0cf991 100644 --- a/packages/language-picker/tsconfig.json +++ b/packages/language-picker/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { - "target": "ES2016", - "module": "esnext", + "target": "ES5", + "lib": [ "DOM", "ES2020" ], + "module": "ESNext", "allowJs": true, "checkJs": false, "jsx": "react", @@ -25,6 +26,8 @@ "types": [], "rootDir": "src", + "importHelpers": true, + "composite": true }, "include": [ "src" ] diff --git a/packages/search/package.json b/packages/search/package.json index bb9173fdb25a1..460f009f02cbc 100644 --- a/packages/search/package.json +++ b/packages/search/package.json @@ -34,7 +34,8 @@ "@wordpress/i18n": "^3.14.0", "@wordpress/icons": "^2.4.0", "classnames": "^2.2.6", - "lodash": "^4.17.15" + "lodash": "^4.17.15", + "tslib": "^1.10.0" }, "peerDependencies": { "react": "^16.8", diff --git a/packages/search/tsconfig.json b/packages/search/tsconfig.json index 146ee4ec6eee0..9f9b0cc0cf991 100644 --- a/packages/search/tsconfig.json +++ b/packages/search/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { - "target": "es2018", - "module": "esnext", + "target": "ES5", + "lib": [ "DOM", "ES2020" ], + "module": "ESNext", "allowJs": true, "checkJs": false, "jsx": "react", @@ -25,6 +26,8 @@ "types": [], "rootDir": "src", + "importHelpers": true, + "composite": true }, "include": [ "src" ]