has anybody ever successfully managed to add momen...
# suitescript
t
has anybody ever successfully managed to add moment-timezone into SS2 script. it tries to load moment when you include moment-timezone. I figure I need to change something in this part of the library but not sure what has anyone got any ideas?
Copy code
(function (root, factory) {
	"use strict";

	/*global define*/
	if (typeof module === 'object' && module.exports) {
		module.exports = factory(require('moment')); // Node
	} else if (typeof define === 'function' && define.amd) {
		define(['moment'], factory);                 // AMD
	} else {
		factory(root.moment);                        // Browser
	}
}(this, function (moment) {
b
moment timezone expects there to be a module named moment
you can accomplish this without modifying moment timezone by using a require config
you can also accomplish it by changing how moment timezone defines it dependencies, but thats more hacky
which method do you want help on
t
The easier none hacky way 🙂 using require config
b
the non hacky way is not easier
t
lol ohh I thought it would be. I would like to understand the require config way as it is the right way
b
@nzy way is the correct way
😉 1
you will probably need a context key with a unique value in the string in the json he gave you