Portfolio Website & tech blog of Bharathi Kannan Live at https://www.bharathikannan.com/
Please refer to Projects
npm install
npm run dev
Windows:
Run ipconfig
and get the ipaddress of your localhost
MAC:
Run ifconfig
and get the ipaddress of your localhost
Open that address on the mobile with the same portnumber.
Ex: 192.168.1.9:3001
npm run analyze
Enable productionBrowserSourceMaps: true
in next.config.js
Next Source Maps
and then npm run build
then run the source-map-explorer command
source-map-explorer chunk_name.js
Make sure you have installed source-map-explorer:
npm install -g source-map-explorer
Sitemap file gets updated automatically by this awesome package - next-sitemap
npm run build
would be executed during deployment.- After build
postbuild
script would be executed, which updates sitemaps.
Its tricky to generate screenshots when tests are running in Github actions.
To update screenshots for blog posts in CI (Github actions), we need to build the screenshots via docker in local.
👉 Check this PR for instructions on first time set up.
Run npx playwright test --update-snapshots
, it will generate new screenshot files for -darwin.png
- On root of the project directory, open a terminal (/blog).
- Run
docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.33.0-jammy /bin/bash
.- This will sync the local folder with docker folder
rm -rf node_modules
- Deletes node_modules- This is to do fresh installation of node modules based on linux platform.
npm install
npx playwright install --with-deps
- Reinstall playwright dependenciesnpx playwright test --update-snapshots
- Runs and updates screenshots- This step will generate new screenshots based on linux platform (
-linux.png
).
- This step will generate new screenshots based on linux platform (
- Commit the same to the repository.
The downside of this approach is, after updating linux screenshots, on local we again need
to remove node_modules
and do fresh npm install
for running the app.
Eslint, Prettier Configs provided by Arpit Bharti