I'm using Angular2 via angular2-seed (which uses SystemJS) and trying to load moment-timezone and use moment.tz.guess()
specifically.
I import via:
import * as moment from 'moment-timezone';
When I do this I get the following error in my browser:
GET /node_modules/moment-timezone/data/packed/latest.json.js 404 (Not Found)
anuglar2-seed uses defaultJSExtensions
which I think is why the incorrect .js
is being added, so I figured I could just turn this off for moment-timezone
in tools/config/project.config.ts
like so:
this.SYSTEM_BUILDER_CONFIG.packages['moment-timezone'] = {
defaultExtension: false
//I have also tried:
map: {
'/node_modules/moment-timezone/data/packed/latest.json.js': '/node_modules/moment-timezone/data/packed/latest.json',
'/node_modules/moment-timezone/data/packed/latest.json': '/node_modules/moment-timezone/data/packed/latest.json'
}
};
However, this is not working. What am I doing wrong?