Homework for Bambee FS Dev
#install packages
yarn install
# download and build the docker images, and build the app
docker-compose up -d
# start nodemon
# If this fails on init, run the Terminal #2 commands and then re-run this command
# For some reason, the webpack initial build can fail to create the dist folder required to serve the files
make serve
# run webpack and watch the files
npm run dev
# or
yarn dev
Why
make
instead ofnpm
?
These commands indeed do run npm commmands but they run inside the docker container. This saves you from having to type out the docker commands every time.
Chrome canary now ships with a node debugger button as shown below:
Click on that, and make sure you have localhost:9229 as a source. A console for the app should show up when it starts.
# Create a production build
npm run build
# Log into the container shell
make shell
# Run node console inside docker
make console
make FILE=path/to/file.test.ts test-file
make test