- your entry point to any app
- holds configuration, metadata (version, name, etc), dependencies and scripts
- npm -> Node Package Manager
- command line tool that installs, updates or uninstalls Node.js packages in your application
- online repository for open-source Node.js packages
- https://npmjs.com/
- Install locally:
npm install <package name>
- Install globally:
npm install -g <package name>
- Install and Save to package.json:
npm install <package name> --save
- Uninstall
npm uninstall <package name>
- defines what browsers our app can run on. That is, the build process makes sure the output artifact can run in the specified browsers
- to check what each query means, run
npx browserslist <query>
- traditional html file
- you can add dependencies here too (not recommended)
- PUBLIC_URL -> use this instead of ./ to avoid problems
- simply run
npm run build
yarn global add serve
serve -s build
- create your Github repo
- add a new folder
.github/workflows
- add the
build-deploy.yml
file in this project - in
package.json
, add a new key/value as:"homepage": "https://prof-tejera.github.io/<repo>"
- commit your files (make sure package-lock.json is there)
- If you don't have a
gh-pages
branch you will have to create one and push it to Github. You can find instructions on how to create a branch here
- Go to
Settings
- Go to
Pages
- in
Source
, selectgh-pages
branch - Click Save
Once the build-deploy
action finishes running, the app should be live
at https://prof-tejera.github.io/<repo>