{"id":19505894,"url":"https://github.com/morlay/babel-plugin-transform-ensure-ignore","last_synced_at":"2025-04-26T02:32:09.392Z","repository":{"id":69524076,"uuid":"49068396","full_name":"morlay/babel-plugin-transform-ensure-ignore","owner":"morlay","description":null,"archived":false,"fork":false,"pushed_at":"2016-01-05T13:57:19.000Z","size":3,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T21:46:09.260Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morlay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-05T13:43:44.000Z","updated_at":"2019-08-03T20:23:34.000Z","dependencies_parsed_at":"2023-02-26T21:31:36.460Z","dependency_job_id":null,"html_url":"https://github.com/morlay/babel-plugin-transform-ensure-ignore","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"484b47778dffabf9446a44ce83f80b69639a9883"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbabel-plugin-transform-ensure-ignore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbabel-plugin-transform-ensure-ignore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbabel-plugin-transform-ensure-ignore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbabel-plugin-transform-ensure-ignore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morlay","download_url":"https://codeload.github.com/morlay/babel-plugin-transform-ensure-ignore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602310,"owners_count":21131615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-10T22:34:43.751Z","updated_at":"2025-04-26T02:32:09.076Z","avatar_url":"https://github.com/morlay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## babel-plugin-transform-ensure-ignore\n\n[![Build Status](https://img.shields.io/travis/morlay/babel-plugin-transform-ensure-ignore.svg?style=flat-square)](https://travis-ci.org/morlay/babel-plugin-transform-ensure-ignore)\n[![NPM](https://img.shields.io/npm/v/babel-plugin-transform-ensure-ignore.svg?style=flat-square)](https://npmjs.org/package/babel-plugin-transform-ensure-ignore)\n[![Dependencies](https://img.shields.io/david/morlay/babel-plugin-transform-ensure-ignore.svg?style=flat-square)](https://david-dm.org/morlay/babel-plugin-transform-ensure-ignore)\n[![License](https://img.shields.io/npm/l/babel-plugin-transform-ensure-ignore.svg?style=flat-square)](https://npmjs.org/package/babel-plugin-transform-ensure-ignore)\n\n\n`require.ensure` is cool, but we don't need it in Node env.\n\nsee more \u003chttps://webpack.github.io/docs/code-splitting.html#defining-a-split-point\u003e\n\nthis plugin will help to transform code below:\n\n```js\nrequire.ensure([], (require) =\u003e {\n  require.include('./some-module');\n  require('./some-module');\n});\n```\n\nto\n```js\nrequire('./some-module');\n```\n\nConfigure it in `.babelrc` for node, we could ignore the requirement when run test in node or build server render app.\nThen we run babel with `BABEL_ENV=node` will active this plugin;\n\n\n```js\n{\n  \"env\": {\n    \"node\": {\n      \"plugins\": [\n        \"babel-plugin-transform-ensure-ignore\"\n      ]\n    }\n  }\n}\n```\n\nor use with `babel-register` in require-hooks\n\n```js\nrequire('babel-register')({\n  'plugins': [\n     'babel-plugin-transform-ensure-ignore'\n  ]\n});\n```\n\nOr with cli like other plugin used.\n\n**Notice:**\n\n* Don't use this in webpack system\n* make sure the correct usage of `require.ensure`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorlay%2Fbabel-plugin-transform-ensure-ignore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorlay%2Fbabel-plugin-transform-ensure-ignore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorlay%2Fbabel-plugin-transform-ensure-ignore/lists"}