Pm2: Replace momentjs with dayjs or luxon to drastically reduce bundle size

Created on 28 Nov 2019  路  5Comments  路  Source: Unitech/pm2

Replace to reduce bundle size. Moment.js is about 20x heavier than dayjs and does basically the same thing :(
Day.js https://github.com/iamkun/dayjs
Luxon https://moment.github.io/luxon/

Inspecting Pending Release

Most helpful comment

date-fns + moment have been replaced by dayjs

All 5 comments

Yes true that moment is bloated: https://bundlephobia.com/[email protected]
I already started to migrate from moment with date-fns: https://bundlephobia.com/[email protected]

I wonder if I Luxon is a drop in replacement of moment

moment().format('LTS') moment().diff(parseInt(t1))

This are the only momentjs calls ^^' so yes I will drop moment

dayjs is a drop in replacement of moment, and is even lighter than date-fns... https://bundlephobia.com/[email protected]

date-fns + moment have been replaced by dayjs

PM2 4.3.0 published:

npm install pm2@latest -g
pm2 update
Was this page helpful?
0 / 5 - 0 ratings

Related issues

liujb picture liujb  路  3Comments

ldarren picture ldarren  路  3Comments

jubairsaidi picture jubairsaidi  路  3Comments

morfies picture morfies  路  3Comments

alexpts picture alexpts  路  3Comments