I have been using moment.js
in a page in my Sapper app. When I build the project, I noticed that moment.js
takes up quite some space, so I tried to switch over to dayjs instead.
However, whenever I try to open the page in which I am using day.js
, the page simply fails and says that it is taking a long time to respond. Any ideas why this is happening?
Steps to reproduce
Info
I just test it and it's working fine if you import it as a module:
<script>
import dayjs from "dayjs";
console.log(dayjs("2018-08-08"));
</script>
You will see in the console something like:
{
$L: "en"
$d: Wed Aug 08 2018 00:00:00 GMT+0200 (Central European Summer Time)
$y: 2018
$M: 7
...
}
Checkout the sapper codesandbox and the classic svelte codesandbox to see it live.