Is anyone successfully using the 2.x release with locales and webpack?
The following results in a Cannot read property 'delimiters' of undefined error:
import numeral from "numeral"
numeral.locale("nl-nl")
And when I try this
import numeral from "numeral"
import numeralnl from "numeral/locales/nl-nl"
numeral.register("locale", "nl-nl", numeralnl)
numeral.locale("nl-nl")
It throws the Uncaught TypeError: nl-nl locale already registered error.
With 1.5.x this was working properly:
import numeral from "numeral"
import numeralnl from "numeral/languages/nl-nl"
numeral.language("nl-nl", numeralnl)
numeral.language("nl-nl")
I've managed to make it work like this:
import numeral from "numeral"
import numeralen from "numeral/locales/en-gb"
numeral.locale("en-gb")
I was having the Cannot read property 'delimiters' of undefined issue as well.
Running on:
"webpack": "^1.13.2"
"numeral": "^2.0.4",
Thanks, that works!
In Webpack 4 (Angular 5) I had to use:
import * as numeral from "numeral";
const numeralen = require("numeral/locales/de-ch");
numeral.locale("de-ch");
Most helpful comment
I've managed to make it work like this:
I was having the
Cannot read property 'delimiters' of undefinedissue as well.Running on: