Skip to content

Compiling Globalize with cldr/supplemental data being accessible #41

@harel

Description

@harel

I'm having a problem using the globalize-webpack-plugin when production is set to true.
My application allows switching locales on the fly. It also looks at some cldr data within globalize in a couple of instances (to pull current locale's time format or the current locale's first day of the week.

For example, when locale is a loaded Globalize instane:
locale.cldr.get('supplemental').weekData
or
locale.cldr.supplemental.timeData.preferred()

However, although it works fine when production is false, once i set it to true and build, the compiler, and rightly so, omits the cldr attribute from the compiled Globalize.
I can see that the globalize compiler allows compiling with cldr data in, but I can't see how to tell the webpack plugin to do this.

Any ideas? Or is there an alternative way to have those data points available in the compiled instance?

Update: If i fudge those values in my source, to progress with the runtime, my app then fails to parse any messages, and in some cases parses data from the wrong file (a few sparse cases).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions