google / jsonnet

Jsonnet - The data templating language
http://jsonnet.org
Apache License 2.0
6.98k stars 440 forks source link

Consider adding a "minifier"/"compiler"-like option to libjsonnet #1044

Open mikehoyle-google opened 1 year ago

mikehoyle-google commented 1 year ago

I have a usecase in which I would love to have an equivalent to a javascript "minifier".

That is, a tool which reads a jsonnet file, resolves imports, performs static analysis etc, but instead of then evaluating the jsonnet, it simply returns a string of text that contains all the jsonnet input, in a single file (optionally without comments, and other configuration).

I don't see a way of currently doing this with the existing tooling, but it seems like it should be relatively accomplishable given what's already present.

sbarzowski commented 1 year ago

This could be implemented as a separate tool, either included in the repo or a completely separate one. Probably best to base it on go-jsonnet.