Export compiled name map for use by non-JS backends #864
DanielHeath
started this conversation in
Ideas
Replies: 1 comment
-
I've added the callback I need in #865 . |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've quickly come to prefer vanilla-extract. However, my existing application backend isn't javascript, making the generated classnames inaccessible to server-rendered markup.
However, I can see a way to bridge this gap:
Currently the
esbuild
plugin generates its exports as typescript usingexport var ${key} = ${stringifyExports(...
.If it also generated a json file containing the mapping (and had the ability to save this somewhere), I could hook it up to the backend application also.
Generating solely json would break the handling of
default
but would otherwise work identically in esbuild.At first reading, the most 'obvious' way I can see to do it would be to alter
processVanillaFile
to passfilePath
andevalResult
to a user-defined callback, if present.Beta Was this translation helpful? Give feedback.
All reactions