{"id":17704995,"url":"https://github.com/dwqs/babel-plugin-on-demand-import","last_synced_at":"2025-03-13T08:31:50.384Z","repository":{"id":57110192,"uuid":"124734016","full_name":"dwqs/babel-plugin-on-demand-import","owner":"dwqs","description":"Babel plugin for importing components on demand","archived":true,"fork":false,"pushed_at":"2018-04-20T14:05:58.000Z","size":20,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T01:05:21.567Z","etag":null,"topics":["babel","babel-plugin","import","on-demand"],"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/dwqs.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-03-11T07:36:19.000Z","updated_at":"2025-01-14T09:47:15.000Z","dependencies_parsed_at":"2022-08-21T07:31:01.632Z","dependency_job_id":null,"html_url":"https://github.com/dwqs/babel-plugin-on-demand-import","commit_stats":null,"previous_names":["dwqs/babel-plugin-import-on-demand"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fbabel-plugin-on-demand-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fbabel-plugin-on-demand-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fbabel-plugin-on-demand-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwqs%2Fbabel-plugin-on-demand-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwqs","download_url":"https://codeload.github.com/dwqs/babel-plugin-on-demand-import/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243369886,"owners_count":20280095,"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","import","on-demand"],"created_at":"2024-10-24T22:05:49.037Z","updated_at":"2025-03-13T08:31:49.974Z","avatar_url":"https://github.com/dwqs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build pass](https://api.travis-ci.org/dwqs/babel-plugin-on-demand-import.svg?branch=master)](https://travis-ci.org/dwqs/babel-plugin-on-demand-import?branch=master) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com) ![npm-version](https://img.shields.io/npm/v/babel-plugin-on-demand-import.svg) ![license](https://img.shields.io/npm/l/babel-plugin-on-demand-import.svg)\n# babel-plugin-on-demand-import\nBabel plugin for importing components on demand.\n\n## Installation\nInstall the pkg with npm:\n\n```\nnpm i babel-plugin-on-demand-import -D\n```\n\nor yarn\n\n```\nyarn add babel-plugin-on-demand-import -D\n```\n\n## Usage\n\nVia `.babelrc` or babel-loader.\n\n```\n{\n  \"plugins\": [[\"on-demand-import\", options]]\n}\n```\n\n### options\n\n`options` can be object.\n\n```\n{\n    libraryName: 'test',\n    libraryPath: 'lib',  // default: lib\n    stylePath: 'your-style-path', // defalut: undefined\n    needImportStyle: true       // default: false\n}\n```\n\n`options` can be an array.\n\n```\n[\n    {\n        libraryName: 'test1'\n    },\n    {\n        libraryName: 'test2'\n    }\n]\n```\n\n## Example\n\n**{ \"libraryName\": \"test1\" }**\n\n```js\nimport { A } from 'test1';\n\n↓ ↓ ↓ ↓ ↓ ↓\n\nvar a = require('test1/lib/a');\n```\n\n**{ \"libraryName\": \"test2\", libraryPath: 'dist/my-library', stylePath: 'style1', needImportStyle: true }**\n\n```\nimport { B } from 'test2';\n\n↓ ↓ ↓ ↓ ↓ ↓\n\nvar b = require('test2/dist/my-library/b');\nrequire('test2/style1/b.css');\n```\n\n## Used Components\n* [v2-datepicker](https://github.com/dwqs/v2-datepicker/)\n* [vue-area-linkage](https://github.com/dwqs/vue-area-linkage)\n* [react-area-linkage](https://github.com/dwqs/react-area-linkage)\n\n## Similar project\n* [babel-plugin-replace-import-path](https://github.com/fmfe/babel-plugin-replace-import-path)\n\n## LICENSE\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwqs%2Fbabel-plugin-on-demand-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwqs%2Fbabel-plugin-on-demand-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwqs%2Fbabel-plugin-on-demand-import/lists"}