{"id":21906646,"url":"https://github.com/enlight/ibsforts-plugin-babel","last_synced_at":"2026-05-09T15:37:17.162Z","repository":{"id":137247423,"uuid":"48780378","full_name":"enlight/ibsforts-plugin-babel","owner":"enlight","description":"Runs Babel on code emitted by the Incremental Build Server for TypeScript.","archived":false,"fork":false,"pushed_at":"2016-01-19T10:02:50.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T07:29:35.529Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/enlight.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":"2015-12-30T03:44:41.000Z","updated_at":"2016-01-19T10:02:50.000Z","dependencies_parsed_at":"2023-03-20T02:05:27.708Z","dependency_job_id":null,"html_url":"https://github.com/enlight/ibsforts-plugin-babel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/enlight/ibsforts-plugin-babel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enlight%2Fibsforts-plugin-babel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enlight%2Fibsforts-plugin-babel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enlight%2Fibsforts-plugin-babel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enlight%2Fibsforts-plugin-babel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enlight","download_url":"https://codeload.github.com/enlight/ibsforts-plugin-babel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enlight%2Fibsforts-plugin-babel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32824540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-28T16:54:00.181Z","updated_at":"2026-05-09T15:37:17.132Z","avatar_url":"https://github.com/enlight.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ibsforts-plugin-babel\nRuns [Babel](http://babeljs.io) on code emitted by the [Incremental Build Server for TypeScript](https://github.com/enlight/ibsforts).\n\n## Limitations\n- No support for inline source maps (though it wouldn't be that hard to do).\n\n## Setup\n```\nnpm install enlight/ibsforts-plugin-babel --save-dev\n```\n\n## Usage\nHere's an example of plugging in the `babelTransform` function provided by this package into a\nbuild server:\n```typescript\nimport { IncrementalBuildServer, ProjectLoader } from 'ibsforts';\nimport { babelTransform } from 'ibsforts-plugin-babel';\n\nfunction babelTransformPlugin(inputFiles: ts.OutputFile[]): Promise\u003cts.OutputFile[]\u003e {\n  const options: babel.IOptions = {\n    babelrc: false,\n    // Get Babel to convert ES6 constructs Node v4 doesn't support to ES5.\n    plugins: [\n      'babel-plugin-transform-strict-mode',\n      'babel-plugin-transform-es2015-parameters',\n      'babel-plugin-transform-es2015-destructuring',\n      'babel-plugin-transform-es2015-spread'\n    ]\n  };\n  return babelTransform(inputFiles, options);\n}\n\nconst server = new IncrementalBuildServer(new Logger());\nProjectLoader.loadFromConfigFile('../src/tsconfig.json')\n.then(project =\u003e {\n  project.postCompileTransforms.push(babelTransformPlugin);\n  server.watchProject(project);\n});\n```\n\n## Debugging\nIf you'd like to see what the code looks like before an after Babel transforms it you can use the\n`babelTransformDebug` function provided by this package, it works similarly to `babelTransform`\nbut takes two extra arguments, these should be functions, and they will be invoked before and\nafter code is transformed. For example you could replace the `babelTransformPlugin` function in the\nexample above with the following:\n```typescript\nimport * as fsp from 'fs-promisified';\n\nfunction debugInputFile(file: ts.OutputFile): Promise\u003cvoid\u003e {\n  return fsp.writeFile(file.name + '.babel_in', file.text, 'utf8');\n}\n\nfunction debugOutputFile(file: ts.OutputFile): Promise\u003cvoid\u003e {\n  return fsp.writeFile(file.name + '.babel_out', file.text, 'utf8');\n}\n\nfunction babelTransformPlugin(inputFiles: ts.OutputFile[]): Promise\u003cts.OutputFile[]\u003e {\n  const options: babel.IOptions = { ... };\n  return babelTransformDebug(inputFiles, options, writeBabelInputToFile, writeBabelOutputToFile);\n}\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenlight%2Fibsforts-plugin-babel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenlight%2Fibsforts-plugin-babel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenlight%2Fibsforts-plugin-babel/lists"}