{"id":21527163,"url":"https://github.com/gpittarelli/babel-plugin-transform-resolve-wildcard-import","last_synced_at":"2025-04-09T23:34:50.954Z","repository":{"id":57188963,"uuid":"95057080","full_name":"gpittarelli/babel-plugin-transform-resolve-wildcard-import","owner":"gpittarelli","description":"Simple transform to strip some wildcard imports","archived":false,"fork":false,"pushed_at":"2019-09-22T22:37:50.000Z","size":14,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-29T07:20:09.900Z","etag":null,"topics":["babel","babel-plugin","es6","import"],"latest_commit_sha":null,"homepage":"","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/gpittarelli.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":"2017-06-22T00:10:05.000Z","updated_at":"2018-12-13T14:46:31.000Z","dependencies_parsed_at":"2022-08-28T11:11:38.832Z","dependency_job_id":null,"html_url":"https://github.com/gpittarelli/babel-plugin-transform-resolve-wildcard-import","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpittarelli%2Fbabel-plugin-transform-resolve-wildcard-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpittarelli%2Fbabel-plugin-transform-resolve-wildcard-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpittarelli%2Fbabel-plugin-transform-resolve-wildcard-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpittarelli%2Fbabel-plugin-transform-resolve-wildcard-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gpittarelli","download_url":"https://codeload.github.com/gpittarelli/babel-plugin-transform-resolve-wildcard-import/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247805112,"owners_count":20999109,"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","es6","import"],"created_at":"2024-11-24T01:47:59.285Z","updated_at":"2025-04-09T23:34:50.922Z","avatar_url":"https://github.com/gpittarelli.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-transform-resolve-wildcard-import\n\nTransforms wildcard style imports:\n\n```javascript\n    import * as x from 'y';\n    import * as w from 'z';\n    x.a();\n    x.b();\n    console.log(Object.values(w));\n```\n\ninto member style imports:\n\n```javascript\n    import {a, b} from 'y';\n    import * as w from 'z';\n    a();\n    b();\n    console.log(Object.values(w));\n```\n\n(well, that would be ideal, but actually it looks more like the\nfollowing, which is a bit simpler to implement:)\n\n```javascript\n    import {a as _a, b as _b} from 'y';\n    import * as w from 'z';\n    var x = {a: _a, b: _b};\n    x.a();\n    x.b();\n    console.log(Object.values(w));\n```\n\nThis is useful in some situations to get webpack and similar tools to\ntree-shake better.\n\nNote: This plugin only works when the wildcard import (`x` in the\nexample) is only ever used in a property access. If you use `x`\ndirectly, then we leave the wildcard import in place.\n\n## Options\n\nBy default this will apply to all wildcard imports, for example with a\n.babelrc like:\n\n    {\n        \"plugins\": [\"babel-plugin-transform-resolve-wildcard-import\"]\n    }\n\nIf you only want it to apply this to certain import paths you can\nrestrict the transforms with an array of regular expressions passed as\n`only`:\n\n    {\n        \"plugins\": [\n            [\"babel-plugin-transform-resolve-wildcard-import\", {only: [\n                \"^lodash$\",\n                \"^\\.\\.?\\/UI(\\/(index(\\.js)?)?)?$\"\n            ]}]\n        ]\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpittarelli%2Fbabel-plugin-transform-resolve-wildcard-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpittarelli%2Fbabel-plugin-transform-resolve-wildcard-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpittarelli%2Fbabel-plugin-transform-resolve-wildcard-import/lists"}