Hi this is just a random blog I'm putting up so I can share some thoughts and just mess around with stuff.
At first I just wanted to get a blog going, github pages to the rescue! Fast and easy setup.
Now how will I maintain this simple index.html
as my blog may grow. No problem I'm not going to write a lot. Oh man...I'm writing a lot...ok ok no problem we’ll just add sections and text manually...
Ugghhh I'm so laaazzzyyy.
So I tried a couple of things.
- Added
parcel
to get a dev environment going (btw first time usingparcel
). - Wait...can I do this in
React
?
Now...we're here.
parcel
builds the project fordev
and"production"
with the entry filed beingsrc/index.html
yarn dev
will build and watch for changes, open localhost:1234
- For
yarn production
I wrote scripts in thepackage.json
- first it will clean up
dist/
withyarn clean_dist
- by default
parcel build src/index.html
will create adist
folder and place everything there- I needed to build into root directory,
parcel build --public-url . src/index.html
- The
--public-url
means our<link href= && <script src=
build to whatever destination you want. --public-url .
means current working directory for me it's theroot
where all my files will be
- I needed to build into root directory,
- third it will clean up our
root
direction and remove all previously build files - finally it will copy the content of
dist
into the root folder
- first it will clean up
- Now all you have to do is push up the changes and github pages will pick up the new index.html
That's it. You can develop however you want in the src/
folder add/remove directories etc