I know that I need to import the moment plugin if I want to use it. Like this:
import * as moment from "moment-timezone";
But what if I want to use multiple plugins? I know that plugins instantly import the moment, add their functionality, and then export the moment again. But if this is correct, how can I use multiple plugins?
One option is to import them under a different name, for example:
import * as momentJdate from "moment-jdateformatparser";
import * as momentTimezone from "moment-timezone";
Or I can combine them at one point like this (using deepExtend):
let moment = {};
deepExtend(moment, momentJdate, momentTimezone);
But none of them look like pure code. Is there a better way to do this?
source
share