How to work with minification? #27
Unanswered
QuickScoP3s
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hm this is a use case I hadn't thought of. What if you defined your options object dynamically? const customOptions: SerifyOptions<CustomFooTypeMap> = {
...defaultOptions
serifyKey: 42,
types: {
...defaultOptions.types,
[typeof Foo]: {
serifier: (value) => value.p,
deserifier: (value) => new CustomFoo(value)
}
}
} ... or something like that, don't know offhand if I'll think about it, and meanwhile if you come up with a dynamic approach that works, let me know and I'll integrate it. Or here's a much simpler approach that will get you moving right away: create a wrapper class for the luxon DateTime that DOES have |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using serify for use with Redux, because I wanted a global setup to save luxon's DateTime object to the store.
However, using Vite the build will be minified, thus the name "DateTime" does not work, as
constructor.name
will return something random.How can I configure serify to correctly identify library objects that don't have the
serifyStaticTypeProperty
?Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions