Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
http://codegolf.stackexchange.com/questions/37624/#answers
http://codegolf.stackexchange.com/questions/2682/#answers
Interesting. I didn't realize Hackmud supported ECMAScript 6, or at least the arrow syntax part of it. Now I'm curious what else it supports for ECMAScript 6... Thanks for the insights!
sed -r 's/([a-z0-9_]+).?=.?function\(([a-z0-9_]+)\)/\1 = (\2) =>/g'
uglifyjs lock_sim_dev.js -m | sed -r 's/main\(/\(/g' | sed -r 's/HASHTAG/#s/g' > lock_sim_dev_min.js
In your code just replace #s with HASHTAG and sed will replace it back after it is done
Good advice, though it doesn't account for needing to manually insert '#s' references into the final script since UglifyJS won't parse the file with it present. I might play around with using sed to do so instead of needing to do it manually. Thanks for the idea!
This assumes you are using function main( to define the function.
It runs uglify and then replaces main( with just ( and then outputs it to a file. This way you don't have to go back and manually edit it
uglifyjs script_input.js -m | sed -r 's/main\(/\(/g' > script_output_min.js