mobile: fix module resolution

This commit is contained in:
ammarahm-ed
2023-06-20 12:04:38 +05:00
parent 04d122c47c
commit 2b94212552
2 changed files with 16 additions and 6 deletions

View File

@@ -23,7 +23,17 @@ module.exports = {
"react": path.join(__dirname, "../node_modules/react"),
"react-dom": path.join(__dirname, "../node_modules/react-dom"),
"@notesnook": path.join(__dirname, "../../../packages"),
"@notifee/react-native": path.join(__dirname, "../node_modules/@ammarahmed/notifee-react-native")
"@notifee/react-native": path.join(__dirname, "../node_modules/@ammarahmed/notifee-react-native"),
},
resolveRequest: (context, moduleName, platform) => {
if (moduleName ==='react') {
// Resolve react package from mobile app's node_modules folder always.
return {
filePath: path.resolve(path.join(__dirname, '../node_modules', "react","index.js")),
type: 'sourceFile',
};
}
return context.resolveRequest(context, moduleName, platform);
}
},
transformer: {

View File

@@ -8,10 +8,12 @@
"name": "@notesnook/common",
"version": "1.0.0",
"license": "GPL-3.0-or-later",
"dependencies": {
"timeago.js": "4.0.2"
},
"devDependencies": {
"@types/react": "17.0.2",
"react": "17.0.2",
"timeago.js": "4.0.2",
"typescript": "^4.8.2"
},
"peerDependencies": {
@@ -84,8 +86,7 @@
"node_modules/timeago.js": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/timeago.js/-/timeago.js-4.0.2.tgz",
"integrity": "sha512-a7wPxPdVlQL7lqvitHGGRsofhdwtkoSXPGATFuSOA2i1ZNQEPLrGnj68vOp2sOJTCFAQVXPeNMX/GctBaO9L2w==",
"dev": true
"integrity": "sha512-a7wPxPdVlQL7lqvitHGGRsofhdwtkoSXPGATFuSOA2i1ZNQEPLrGnj68vOp2sOJTCFAQVXPeNMX/GctBaO9L2w=="
},
"node_modules/typescript": {
"version": "4.9.5",
@@ -158,8 +159,7 @@
"timeago.js": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/timeago.js/-/timeago.js-4.0.2.tgz",
"integrity": "sha512-a7wPxPdVlQL7lqvitHGGRsofhdwtkoSXPGATFuSOA2i1ZNQEPLrGnj68vOp2sOJTCFAQVXPeNMX/GctBaO9L2w==",
"dev": true
"integrity": "sha512-a7wPxPdVlQL7lqvitHGGRsofhdwtkoSXPGATFuSOA2i1ZNQEPLrGnj68vOp2sOJTCFAQVXPeNMX/GctBaO9L2w=="
},
"typescript": {
"version": "4.9.5",