js-playground
js-playground copied to clipboard
a place to post experimental creations
js-playground
experimental javascript creations:
run the dev server
note: sudo may be required for docker interaction based on your installation config.
To run the website in a local environment:
- make sure Docker is installed
- clone this repository
git clone [email protected]:mac-s-g/js-playground.git
- build the docker container
cd js-playground/./docker/build-container.sh
- run the development server
./docker/dev-server.sh
- navigate to http://localhost:3300/ in your web browser
After completing the steps above, you'll have webpack-dev-server running in a Docker container with hot-reloading enabled. Try updating some source code. Changes will be reflected in your browser after saving.
notes: if you change the dependencies in package.json, make sure you rebulid the container with ./docker/build-container.sh.
run the build
The build runs in a container and outputs files into js-playground/dist/. Here's how to instantiate the build process:
cd js-playground/./docker/build.sh- Verify the result by exploring the output in your web browser:
cd dist/- open
index.htmlin a web browser
- If your changes look good, send me a pull request!
Without Docker
I'd recommend using docker for development because it enforces environmental consistency.
If you'd like to contribute without docker, you can use the following workflow to run the dev-server:
# clone this repository
git clone [email protected]:mac-s-g/js-playground.git
# install dependencies
npm install
# run the dev server at http://localhost:3100/
npm run dev:hot
and run the build with:
# run the build
npm run build
# copy relevant files into dist dir
cp ./src/images/favicon.ico README.md CNAME ./dist/