{"id":15861936,"url":"https://github.com/afeiship/next-try-require","last_synced_at":"2025-04-01T20:34:30.553Z","repository":{"id":57122881,"uuid":"375629661","full_name":"afeiship/next-try-require","owner":"afeiship","description":"Dynamic require with check if a dependency exists with webpack.","archived":false,"fork":false,"pushed_at":"2021-06-10T10:41:18.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T03:35:12.918Z","etag":null,"topics":["dynamic","next","not-work","require","try"],"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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-10T08:41:52.000Z","updated_at":"2021-06-10T12:19:19.000Z","dependencies_parsed_at":"2022-08-24T14:59:32.465Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/next-try-require","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-try-require","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-try-require/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-try-require/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-try-require/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/next-try-require/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709932,"owners_count":20821297,"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":["dynamic","next","not-work","require","try"],"created_at":"2024-10-05T22:22:07.598Z","updated_at":"2025-04-01T20:34:30.522Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","readme":"# next-try-require\n\u003e Check if a dependency exists with webpack\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```bash\nnpm install -S @jswork/next-try-require\n```\n\n## configuration\n\u003e project_root/config.js\n\n```js\n{\n  test: /\\.(js|mjs|jsx|ts|tsx)$/,\n  include: [\n    paths.appSrc,\n    path.join(__dirname, '../node_modules/@jswork/next-try-require/dist')\n  ],\n  loader: require.resolve('babel-loader')\n}\n```\n\n## usage\n```conf\n└── medias\n    ├── animation.tsx\n    ├── audio.tsx\n    ├── document.tsx\n    ├── image.tsx\n    ├── unknown.tsx\n    └── video.tsx\n```\n\n```js\nimport '@jswork/next-try-require';\n\n// .${context}${path}\n// .${context}${defaults}\n// @${context}${path}\n// @${context}${defaults}\n\nconst MediaComponent = nx.tryRequire(\n  mediaType,\n  'unknown',\n  { context: '/medias/'}\n);\n\n\u003cMediaComponent model={model}/\u003e\n```\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/next-try-require/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/next-try-require\n[version-url]: https://npmjs.org/package/@jswork/next-try-require\n\n[license-image]: https://img.shields.io/npm/l/@jswork/next-try-require\n[license-url]: https://github.com/afeiship/next-try-require/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-try-require\n[size-url]: https://github.com/afeiship/next-try-require/blob/master/dist/next-try-require.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/next-try-require\n[download-url]: https://www.npmjs.com/package/@jswork/next-try-require\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-try-require","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fnext-try-require","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-try-require/lists"}