- Notifications
You must be signed in to change notification settings - Fork0
Astrocoders/lambdasorocaba-5-onegraph
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
npm installnpm start# in another tabnpm run webpack
After you see the webpack compilation succeed (thenpm run webpack
step), open upbuild/index.html
(no server needed!). Then modify whichever.re
file insrc
and refresh the page to see the changes.
For more elaborate ReasonReact examples, please seehttps://github.com/reasonml-community/reason-react-example
To run with the webpack development server runnpm run server
and view in the browser athttp://localhost:8000. Running in this environment provides hot reloading and support for routing; just edit and save the file and the browser will automatically refresh.
Note that any hot reload on a route will fall back to the root (/
), soReasonReact.Router.dangerouslyGetInitialUrl
will likely be needed alongside theReasonReact.Router.watchUrl
logic to handle routing correctly on hot reload refreshes or simply opening the app at a URL that is not the root.
To use a port other than 8000 set thePORT
environment variable (PORT=8080 npm run server
).
npm run cleannpm run buildnpm run webpack:production
This will replace the development artifactbuild/Index.js
for an optimized version as well as copysrc/index.html
intobuild/
. You can then deploy the contents of thebuild
directory (index.html
andIndex.js
).
If you make use of routing (viaReasonReact.Router
or similar logic) ensure that server-side routing handles your routes or that 404's are directed back toindex.html
(which is how the dev server is set up).
To enable dead code elimination, changebsconfig.json
'spackage-specs
module
from"commonjs"
to"es6"
. Then re-run the above 2 commands. This will allow Webpack to remove unused code.
About
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.