![]() Copyright (c) 2015-present 650 Industries, Inc.So we have the following files: - package.json - lerna. This will tell the metro bundler to look for packages on the yarn workspaces' root node_modules directory and resolve all the symlink to their real path. You can use this command to generate a Typescript CRA app npx create-react-app my-app template typescript. mkdir startupui & cd startupui npx lerna init view raw initializelerna.js hosted with by GitHub Let's go through the files generated with it. ![]() ![]() const = require('react-native-yarn-workspace').default(_dirname) Im using: create-react-app 5 yarn workspaces typescript The problem Here I have my gateway and app both depending on packages/types.While gateway worked fine, app complains that Im importing files outside of app/src, since this is a limitation in CRA configuration. yarnrc. yarn add -D npm i -save-dev react-native-yarn-workspace Usage Add a postinstall script to package.jsonĪdd "postinstall": "react-native-yarn-workspace" under the script object in the app's package.json. Yarn V3 (optional) For improved experience I suggest to upgrade yarn to v3+ (yarn set version 3.0.2 & yarn plugin import workspace-tools) and edit the generated config. This package is specifically tweaked to work with bare react-native project. The inner working of this package is same as expo-yarn-workspaces, check it for more details. If you are using expo, use expo-yarn-workspaces instead. To use this package you have to create the react native project using npx react-native init. This package only run on macOs and Linux and haven't tested on ios. ![]() We want apps/react-app to be able to own its whole react-app and have its own. React Native support for Yarn Workspaces. A form management library built using Rollup.js, only because it doesnt contain any HTML or React and is just a module package. Note: this will create a react app at apps/react-app/app which is normally where the base of your repo would be. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |