Initialize repo:
yarn
Start development version:
yarn start
-
Run an instance of a component server like near/bos-loader which serves component code in the following format
{ "components": { "<component path 1>": { "code": "<component 1 code>" }, "<component path 2>": { "code": "<component 2 code>" } } }
this will be used as a
redirectMap
inViewPage
-
Create a
.env
file and set the component server URL asLOCAL_COMPONENT_LOADER
-
Run server in dev mode with
yarn start
Note: there is no hot reload, you must refresh the page to see component changes
If you need to make changes to the VM and test locally, you can easily link your local copy of the VM:
- Clone the viewer repo as a sibling of
near-discovery-alpha
:
git clone [email protected]:NearSocial/VM.git
Folder Structure:
/near-discovery-alpha
/VM
- Initialize the
VM
repo and run the link command:
cd VM
yarn
yarn link
yarn build
- Run the link command inside
near-discovery-alpha
and start the app:
cd ../near-discovery-alpha
yarn link "near-social-vm"
yarn start
- Any time you make changes to the
VM
, runyarn build
inside theVM
project in order for the viewer project to pick up the changes.