From 1b96d0c222166cbe6795ad3467edc6e9ca9b2b75 Mon Sep 17 00:00:00 2001 From: Lukasz Ostafin Date: Thu, 17 Oct 2024 13:48:16 +0200 Subject: [PATCH] IBX-9109: Enabling TypeScript (ts-loader) with Webpack Encore --- ibexa/commerce/5.0/encore/ibexa.webpack.config.js | 1 + ibexa/commerce/5.0/encore/package.json | 11 ++++++++--- ibexa/experience/5.0/encore/ibexa.webpack.config.js | 1 + ibexa/experience/5.0/encore/package.json | 11 ++++++++--- ibexa/headless/5.0/encore/ibexa.webpack.config.js | 1 + ibexa/headless/5.0/encore/package.json | 5 ++++- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ibexa/commerce/5.0/encore/ibexa.webpack.config.js b/ibexa/commerce/5.0/encore/ibexa.webpack.config.js index 563e4731..05ad3113 100644 --- a/ibexa/commerce/5.0/encore/ibexa.webpack.config.js +++ b/ibexa/commerce/5.0/encore/ibexa.webpack.config.js @@ -16,6 +16,7 @@ module.exports = (Encore) => { 'prop-types': 'PropTypes', }) .enableSassLoader() + .enableTypeScriptLoader() .enableReactPreset() .enableSingleRuntimeChunk(); diff --git a/ibexa/commerce/5.0/encore/package.json b/ibexa/commerce/5.0/encore/package.json index 8848a124..c493ae0a 100644 --- a/ibexa/commerce/5.0/encore/package.json +++ b/ibexa/commerce/5.0/encore/package.json @@ -21,11 +21,16 @@ "@ckeditor/ckeditor5-widget": "^40.1.0", "@ckeditor/ckeditor5-theme-lark": "^40.1.0", "@ckeditor/ckeditor5-code-block": "^40.1.0", - "@svgr/webpack": "^8.1.0" + "@svgr/webpack": "^8.1.0", + "typescript": "^5.6.3", + "ts-loader": "^9.5.1", + "ts-config-ibexa": "https://github.com/ibexa/ts-config-ibexa" }, "dependencies": { - "react": "^18.2.0", - "react-dom": "^18.2.0" + "react": "^18.3.1", + "react-dom": "^18.3.1", + "@types/react": "^18.3.11", + "@types/react-dom": "^18.3.1" }, "license": "UNLICENSED", "private": true, diff --git a/ibexa/experience/5.0/encore/ibexa.webpack.config.js b/ibexa/experience/5.0/encore/ibexa.webpack.config.js index 563e4731..05ad3113 100644 --- a/ibexa/experience/5.0/encore/ibexa.webpack.config.js +++ b/ibexa/experience/5.0/encore/ibexa.webpack.config.js @@ -16,6 +16,7 @@ module.exports = (Encore) => { 'prop-types': 'PropTypes', }) .enableSassLoader() + .enableTypeScriptLoader() .enableReactPreset() .enableSingleRuntimeChunk(); diff --git a/ibexa/experience/5.0/encore/package.json b/ibexa/experience/5.0/encore/package.json index 8848a124..c493ae0a 100644 --- a/ibexa/experience/5.0/encore/package.json +++ b/ibexa/experience/5.0/encore/package.json @@ -21,11 +21,16 @@ "@ckeditor/ckeditor5-widget": "^40.1.0", "@ckeditor/ckeditor5-theme-lark": "^40.1.0", "@ckeditor/ckeditor5-code-block": "^40.1.0", - "@svgr/webpack": "^8.1.0" + "@svgr/webpack": "^8.1.0", + "typescript": "^5.6.3", + "ts-loader": "^9.5.1", + "ts-config-ibexa": "https://github.com/ibexa/ts-config-ibexa" }, "dependencies": { - "react": "^18.2.0", - "react-dom": "^18.2.0" + "react": "^18.3.1", + "react-dom": "^18.3.1", + "@types/react": "^18.3.11", + "@types/react-dom": "^18.3.1" }, "license": "UNLICENSED", "private": true, diff --git a/ibexa/headless/5.0/encore/ibexa.webpack.config.js b/ibexa/headless/5.0/encore/ibexa.webpack.config.js index 563e4731..05ad3113 100644 --- a/ibexa/headless/5.0/encore/ibexa.webpack.config.js +++ b/ibexa/headless/5.0/encore/ibexa.webpack.config.js @@ -16,6 +16,7 @@ module.exports = (Encore) => { 'prop-types': 'PropTypes', }) .enableSassLoader() + .enableTypeScriptLoader() .enableReactPreset() .enableSingleRuntimeChunk(); diff --git a/ibexa/headless/5.0/encore/package.json b/ibexa/headless/5.0/encore/package.json index 45ab3163..0df9c54a 100644 --- a/ibexa/headless/5.0/encore/package.json +++ b/ibexa/headless/5.0/encore/package.json @@ -21,7 +21,10 @@ "@ckeditor/ckeditor5-widget": "^40.1.0", "@ckeditor/ckeditor5-theme-lark": "^40.1.0", "@ckeditor/ckeditor5-code-block": "^40.1.0", - "@svgr/webpack": "^8.1.0" + "@svgr/webpack": "^8.1.0", + "typescript": "^5.6.3", + "ts-loader": "^9.5.1", + "ts-config-ibexa": "https://github.com/ibexa/ts-config-ibexa" }, "license": "UNLICENSED", "private": true,