From c4c16c63bc0b15676b113ff560f2182eb7d54797 Mon Sep 17 00:00:00 2001 From: yungblud Date: Tue, 30 Jan 2024 23:25:21 +0900 Subject: [PATCH] fix: handled react native --- package.json | 4 +++- packages/store-client/next.config.js | 17 +++++++++++++++++ packages/store-client/package.json | 7 +++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e64b573..2fa40f8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,9 @@ "**/billets-admin-server", "**/billets-admin-server/**", "**/billets-server", - "**/billets-server/**" + "**/billets-server/**", + "**/react-native", + "**/react-native/**" ] }, "scripts": { diff --git a/packages/store-client/next.config.js b/packages/store-client/next.config.js index e8fe79c..f727ec2 100644 --- a/packages/store-client/next.config.js +++ b/packages/store-client/next.config.js @@ -1,9 +1,26 @@ +/* eslint-disable no-param-reassign */ /** @type {import('next').NextConfig} */ const nextConfig = { experimental: { externalDir: true, }, + webpack: (config) => { + config.resolve.alias = { + ...(config.resolve.alias || {}), + // Transform all direct `react-native` imports to `react-native-web` + 'react-native$': 'react-native-web', + } + config.resolve.extensions = [ + '.web.js', + '.web.jsx', + '.web.ts', + '.web.tsx', + ...config.resolve.extensions, + ] + + return config + }, } module.exports = nextConfig diff --git a/packages/store-client/package.json b/packages/store-client/package.json index ebb8c56..9044d4a 100644 --- a/packages/store-client/package.json +++ b/packages/store-client/package.json @@ -37,7 +37,9 @@ "react-dom": "^18", "react-hook-form": "^7.48.2", "zod": "^3.22.4", - "zustand": "^4.4.7" + "zustand": "^4.4.7", + "react-native-web": "^0.18.12", + "react-spinners": "^0.13.7" }, "devDependencies": { "@tanstack/eslint-plugin-query": "^5.12.1", @@ -46,6 +48,7 @@ "@types/react-dom": "^18", "ts-node": "^10.9.2", "typescript": "^5", - "typescript-plugin-css-modules": "^5.0.2" + "typescript-plugin-css-modules": "^5.0.2", + "react-native": "^0.70.6" } }