{"id":19506055,"url":"https://github.com/morlay/babel-plugin-transform-require-ignore","last_synced_at":"2025-04-30T18:04:39.915Z","repository":{"id":51714083,"uuid":"48168532","full_name":"morlay/babel-plugin-transform-require-ignore","owner":"morlay","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-12T05:36:10.000Z","size":224,"stargazers_count":66,"open_issues_count":6,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-13T07:53:14.898Z","etag":null,"topics":["babel","babel-plugin"],"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":"2015-12-17T10:37:45.000Z","updated_at":"2024-02-25T07:22:46.000Z","dependencies_parsed_at":"2023-02-09T10:16:49.714Z","dependency_job_id":null,"html_url":"https://github.com/morlay/babel-plugin-transform-require-ignore","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbabel-plugin-transform-require-ignore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbabel-plugin-transform-require-ignore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbabel-plugin-transform-require-ignore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morlay%2Fbabel-plugin-transform-require-ignore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morlay","download_url":"https://codeload.github.com/morlay/babel-plugin-transform-require-ignore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235441797,"owners_count":18990775,"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":["babel","babel-plugin"],"created_at":"2024-11-10T22:35:29.219Z","updated_at":"2025-01-24T13:09:44.812Z","avatar_url":"https://github.com/morlay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## babel-plugin-transform-require-ignore\n\n[![Build Status](https://img.shields.io/travis/morlay/babel-plugin-transform-require-ignore.svg?style=flat-square)](https://travis-ci.org/morlay/babel-plugin-transform-require-ignore)\n[![NPM](https://img.shields.io/npm/v/babel-plugin-transform-require-ignore.svg?style=flat-square)](https://npmjs.org/package/babel-plugin-transform-require-ignore)\n[![Dependencies](https://img.shields.io/david/morlay/babel-plugin-transform-require-ignore.svg?style=flat-square)](https://david-dm.org/morlay/babel-plugin-transform-require-ignore)\n[![License](https://img.shields.io/npm/l/babel-plugin-transform-require-ignore.svg?style=flat-square)](https://npmjs.org/package/babel-plugin-transform-require-ignore)\n\n\nSince https://nodejs.org/api/globals.html#globals_require_extensions deprecated.\n\nWe have to find another way to ignore the extensions for webpack usage and make it work in node environment.\n\nConfigure it in `.babelrc` for node, we could ignore the requirement when run test in node or build server render app.\n\nThen we run babel with `BABEL_ENV=node` will active this plugin;\n\n\n```js\n{\n  \"env\": {\n    \"node\": {\n      \"plugins\": [\n        [\n          \"babel-plugin-transform-require-ignore\",\n          {\n            \"extensions\": [\".less\", \".sass\"]\n          }\n        ]\n      ]\n    }\n  }\n}\n\n```\n\nor use with `babel-register` in require-hooks\n\n```\nrequire('babel-register')({\n  'plugins': [\n    [\n      'babel-plugin-transform-require-ignore',\n      {\n        extensions: ['.scss']\n      }\n    ]\n  ]\n});\n\n```\n\nOr with cli like other plugin used.\n\nNotice:\n\nOnly ignore `import './some.less';` or `require('./some.less');`\n\nIf assign to some variable, means that may use css-module,\nplease use https://github.com/css-modules/css-modules-require-hook instead.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorlay%2Fbabel-plugin-transform-require-ignore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorlay%2Fbabel-plugin-transform-require-ignore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorlay%2Fbabel-plugin-transform-require-ignore/lists"}