
JΔnis Smilga π±π» πΊπ¦ #StandWithUkraine
@codingaddict_lv
Followers
9K
Following
3K
Media
128
Statuses
1K
Web Developer β’ π Creator of https://t.co/ksVm1jofjS β’ Tweets about my dev journey
Joined March 2018
Just installed webpack-bundle-analyzer β love the π₯ graphical breakdown of my bundle! Makes spotting bloat so much easier ππ΅οΈββοΈ.Not using Webpack? Check out source-map-explorer or vite-plugin-visualizer π‘.#webpack #webperf #javascript.
1
0
12
π Want to see where a dependency is used in your project?.Run this command:.π npm ls package-name.It shows the full dependency tree π³.Super useful for tracking down nested dependencies π΅οΈββοΈ.#npm #javascript #nodejs #webdev.
1
2
13
Using a this hack in tests:.π const resetSingleton = () => (HashingService as any).instance = undefined;.π§ Calling this in beforeEach() to reset singleton state. π΅οΈββοΈ In general, (SomeClass as any) helps "cheat" TypeScript when tests need to bypass strict typing. #TypeScript#Jest.
0
0
10
Spent an hour debugging a mysterious TypeScript error π΅βπ«.Turns out. webpackCache was the culprit π§¨.Deleted it, and everything worked like magic β¨.#webpack #devlife #typescript π οΈ.
0
0
21
π§ͺ Jest Mocking Gotcha!. π₯ Issue:.π jest.mock('./myModule');.π¨ Returns undefined for EVERYTHING! π«₯. β‘ Your code:.π myModule.doStuff().π₯ Cannot read property 'doStuff' of undefined. π Fix:.jest.mock('./myModule', () => ({ doStuff: jest.fn() }));. #JavaScript #Testing #Jest.
1
1
11
π Git tip: Deleted files not showing up in staging?. git add -A. The -A flag is your friend! It stages ALL changes:.β’ New files β¨.β’ Modified files π.β’ Deleted files ποΈ.β’ Renamed files π. No more ghost files in your staging area! π―. #Git #DevTips #CodingTips.
0
0
13
π§ͺ Jest Testing Tip:. Run single test file:.π "npm test -- yourFileName.spec.ts". OR directly with Jest:.π "jest -- yourFileName.spec.ts". Pro tip: Arrow β¬οΈ key is your friend for finding recent commands!. No config changes needed π. #JavaScript #Testing.
0
0
14
π§ NVM #DevTip: VS Code terminal showing a different Node version than your system terminal?. Add this to your .zshrc:. π "nvm use default".π― Boom! Now both terminals stay in sync with your default Node version. No more version mismatches!.
0
1
26
Check out this Git tip for smoother workflows! π. Run this:. git config --global url.'git@github.com:'.insteadOf '. Git will automatically use SSH instead of HTTPS for GitHub. Seamless coding! π.
3
1
33