Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"sometext\"sometext" is beutified to 'sometext"sometext' #3

Open
paponius opened this issue Dec 12, 2019 · 0 comments
Open

"sometext\"sometext" is beutified to 'sometext"sometext' #3

paponius opened this issue Dec 12, 2019 · 0 comments

Comments

@paponius
Copy link

paponius commented Dec 12, 2019

A data in single quotes then fails as valid JSON.

I guess JSON is passed to uglifyjs as JS and there it's understood as a variable (Array/Object)
where '"' is valid, but not in JSON.

There is an old discussion:
mishoo/UglifyJS#156
Seems like there is no interest in adding the support. But it's old and now I see:

-p, --parse <options>       ...
          `expression`  Parse a single expression, rather than
                    a program (for parsing JSON).
          `spidermonkey`  Assume input files are SpiderMonkey
                   AST format (as JSON).

but I didn't look further.

The thing is, that the standard JSON.stringify works really good.
JSON.stringify(Sites, null, "\t")
outputs a nice beautified JSON.

Would you thing about adding an option to minjson and subsequently to Sublime Editor to use JSON instead of UglifyJS for minjson?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant