Steam'i Yükleyin
giriş
|
dil
简体中文 (Basitleştirilmiş Çince)
繁體中文 (Geleneksel Çince)
日本語 (Japonca)
한국어 (Korece)
ไทย (Tayca)
Български (Bulgarca)
Čeština (Çekçe)
Dansk (Danca)
Deutsch (Almanca)
English (İngilizce)
Español - España (İspanyolca - İspanya)
Español - Latinoamérica (İspanyolca - Latin Amerika)
Ελληνικά (Yunanca)
Français (Fransızca)
Italiano (İtalyanca)
Bahasa Indonesia (Endonezce)
Magyar (Macarca)
Nederlands (Hollandaca)
Norsk (Norveççe)
Polski (Lehçe)
Português (Portekizce - Portekiz)
Português - Brasil (Portekizce - Brezilya)
Română (Rumence)
Русский (Rusça)
Suomi (Fince)
Svenska (İsveççe)
Tiếng Việt (Vietnamca)
Українська (Ukraynaca)
Bir çeviri sorunu bildirin
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