Tweak the example build process. Move example -> examples/trivial to we can have more than one. Update README appropriately.
This commit is contained in:
parent
196ee3f6d4
commit
dff74f44de
7 changed files with 32 additions and 27 deletions
37
README.md
37
README.md
|
@ -3,34 +3,31 @@ matrix-react-sdk
|
|||
|
||||
This is a react-based SDK for inserting a Matrix chat client into a web page
|
||||
|
||||
Getting started with the example
|
||||
================================
|
||||
Getting started with the trivial example
|
||||
========================================
|
||||
|
||||
1. Install or update `node.js` so that your `npm` is at least at version `2.0.0`
|
||||
2. Clone the repo: `git clone https://github.com/matrix-org/matrix-react-sdk.git`
|
||||
3. Switch to your new checkout: `cd matrix-react-sdk`
|
||||
4. Build the CSS: `npm install && npm run build:css`
|
||||
5. Switch to the example: `cd example`
|
||||
6. Build the javascript & copy the CSS:
|
||||
`npm install && npm run build && ln -s ../bundle.css ./`
|
||||
3. Switch to the example directory: `cd matrix-react-sdk/examples/trivial`
|
||||
4. Install the prerequisites: `npm install`
|
||||
5. Build the example and start a server: `npm start`
|
||||
|
||||
Serve the app from within the `example` directory by running `python -m
|
||||
SimpleHTTPServer 8000` and access it at
|
||||
[http://127.0.0.1:8000](http://127.0.0.1:8000/)
|
||||
Now open http://127.0.0.1:8080/ in your browser to see your newly built
|
||||
Matrix client.
|
||||
|
||||
Using the example app for development
|
||||
=====================================
|
||||
|
||||
To develop using the example app, you can avoid havign to repeat the above
|
||||
steps each time you change something:
|
||||
The above commands will let you start working on the app, and any changes you
|
||||
make to the javascript source files will cause the javascript to be rebuilt
|
||||
automatically, but the same will not apply for the CSS.
|
||||
|
||||
1. Perform all the steps above
|
||||
2. In the matrix-react-sdk directory: `npm run start:css`
|
||||
3. Open a new terminal window in the matrix-react-sdk directory:
|
||||
`cd example; npm start`
|
||||
To have the CSS bundle also rebuild as you change it:
|
||||
|
||||
Now, development version of your Javascript and CSS will be rebuilt whenever
|
||||
you change any of the files (although you may need to restart the CSS builder
|
||||
if you add a new file). Note that the debug CSS and Javascript are much, much
|
||||
larger than the production versions.
|
||||
1. `cd matrix-react-sdk`
|
||||
2. `npm start:css`
|
||||
|
||||
Note that you may need to restart the CSS builder if you add a new file. Note
|
||||
that `npm start` builds debug versions of the the javascript and CSS, which are
|
||||
much larger than the production versions build by the `npm run build` commands.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue