From c4574b743b4abb2f2a0ba5126ba7f024b986404a Mon Sep 17 00:00:00 2001 From: Pierre Poupin Date: Mon, 3 Jul 2023 18:16:36 +0200 Subject: [PATCH] fix: make react jsx transform work properly --- packages/core/src/index.ts | 2 ++ packages/core/webpack.config.js | 12 +++++++++++- packages/example/webpack.config.example.js | 12 +++++++++++- yarn.lock | 11 ----------- 4 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 packages/core/src/index.ts diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts new file mode 100644 index 00000000..3dcc78ca --- /dev/null +++ b/packages/core/src/index.ts @@ -0,0 +1,2 @@ +export { Node } from './spatial-navigation/Components/Node'; +export { Root } from './spatial-navigation/Components/Root'; diff --git a/packages/core/webpack.config.js b/packages/core/webpack.config.js index 4bde9f30..462b1cd5 100644 --- a/packages/core/webpack.config.js +++ b/packages/core/webpack.config.js @@ -17,7 +17,17 @@ module.exports = { { test: /\.(ts|tsx)$/, exclude: /node_modules/, - use: ['ts-loader'], + use: [ + { + loader: 'babel-loader', + options: { + presets: ['@babel/preset-env', '@babel/preset-react'], + }, + }, + { + loader: 'ts-loader', + }, + ], }, { test: /\.css$/i, diff --git a/packages/example/webpack.config.example.js b/packages/example/webpack.config.example.js index 7afa4cb2..7582d890 100644 --- a/packages/example/webpack.config.example.js +++ b/packages/example/webpack.config.example.js @@ -24,7 +24,17 @@ module.exports = { { test: /\.(ts|tsx)$/, exclude: /node_modules/, - use: ['ts-loader'], + use: [ + { + loader: 'babel-loader', + options: { + presets: ['@babel/preset-env', '@babel/preset-react'], + }, + }, + { + loader: 'ts-loader', + }, + ], }, { test: /\.css$/i, diff --git a/yarn.lock b/yarn.lock index 72724dcc..19fbe1b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1662,17 +1662,6 @@ __metadata: version: 0.0.0-use.local resolution: "@react-spatial-navigation/core@workspace:packages/core" dependencies: - "@react-native-community/eslint-config": ^3.2.0 - "@typescript-eslint/eslint-plugin": ^5.60.1 - "@typescript-eslint/parser": ^5.60.1 - eslint: ^8.44.0 - eslint-config-prettier: ^8.8.0 - eslint-define-config: ^1.21.0 - eslint-plugin-prettier: ^4.2.1 - eslint-plugin-react: ^7.32.2 - eslint-plugin-react-hooks: ^4.6.0 - eslint-plugin-react-native: ^4.0.0 - prettier: ^2.8.8 webpack: ^5.88.1 webpack-cli: ^5.1.4 webpack-dev-server: ^4.15.1