{"id":20723896,"url":"https://github.com/ying32/babel","last_synced_at":"2026-04-27T18:05:47.007Z","repository":{"id":57516283,"uuid":"154925065","full_name":"ying32/babel","owner":"ying32","description":"jsx编译和压缩","archived":false,"fork":false,"pushed_at":"2018-10-27T08:46:57.000Z","size":1493,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-04T03:06:27.419Z","etag":null,"topics":["babel"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ying32.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-27T04:15:15.000Z","updated_at":"2020-10-03T02:00:25.000Z","dependencies_parsed_at":"2022-08-28T16:50:41.729Z","dependency_job_id":null,"html_url":"https://github.com/ying32/babel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ying32/babel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ying32%2Fbabel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ying32%2Fbabel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ying32%2Fbabel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ying32%2Fbabel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ying32","download_url":"https://codeload.github.com/ying32/babel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ying32%2Fbabel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32348058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel"],"created_at":"2024-11-17T04:10:17.210Z","updated_at":"2026-04-27T18:05:46.987Z","avatar_url":"https://github.com/ying32.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel\njsx编译和压缩，无需Node.js，仅单exe，简单方便。 \n\n----\n\n做这个东东的原因是以前在学习了阿里的antDesign感觉nodejs跟npm用得很不爽，也不喜欢用这两东西，后来就放弃了，直到昨天重新捡起来，看了下antDesign和vue的网站又想起来折腾这事，看到vue有不需要nodejs的方法，就搜索了下antDesign有没有同样的，还真找到了，不过很少而且没几个说明，缺失的太多了，就自己研究起来了，折腾各种库，新的es语法（原antDesign网站上的例子直接来用不了，还折腾了一番语法方面的事情），最后还好都成功了。   \n\n但又遇到了新的问题，有些浏览器又不支持es新语法。又寻找方法发现用babel可以转换，但又涉及到了nodejs，一时间很无奈，太不喜欢nodejs这东西了，最后在github上检索了下有没有go方面的，倒是发现有了，用了几个要不就是编译不过，要不就是想添加新的功能导致无法运行，最后只好都放弃了。从[goja-babel](https://github.com/jvatic/goja-babel)这个项目中了解到babel就是通过一个函数转的而已，于是干脆自己写了（放弃goja-babel是因为我本想给它添加个js压缩功能的插件babili，无奈运行中各莫名奇妙的错）。\n\n# 获取方法\n\n```\ngo get github.com/ying32/babel\ncd xxxxx\ngo build\n\n```\n\n# 使用方法\n```bat\nrem 单一文件编译\nbabel.exe test.jsx\n\nrem 编译目录下所有jsx文件, 后面接目录名就行了\nbabel.exe ./  \n\n```\n\n# 配置文件 babel.json\n可有可无的，如果没有这个会默认使用可执行文件中内置的配置，有则使用这个。\n```json\n{\n\t\"presets\": [\n\t\t\"es2015\",\n\t\t\"react\",\n\t\t\"stage-2\",\n\t\t\"babili\"\n\t],\n\t\"plugins\": [\n\t\t\"transform-react-jsx\",\n\t\t\"transform-es2015-block-scoping\"\n\t]\n}\n```\n\n# 第三方库：\n```\ngithub.com/dop251/goja\n\n```\n\n# 说明\n\n仓库中js目录下的代码来自 https://www.bootcdn.cn/ 网站。这个里面的js只是在开发调试的时候用了下，用目录下的genres可将js生成.go源码直接编译进可执行文件中，这样就不需要带这些东东了。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fying32%2Fbabel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fying32%2Fbabel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fying32%2Fbabel/lists"}