{"id":16347734,"url":"https://github.com/privatenumber/entry-file-plugin","last_synced_at":"2025-03-03T16:30:52.800Z","repository":{"id":48028267,"uuid":"393599182","full_name":"privatenumber/entry-file-plugin","owner":"privatenumber","description":"Create an ESM entry-file in your Webpack build to consolidate entry-point exports","archived":false,"fork":false,"pushed_at":"2021-08-10T23:08:46.000Z","size":96,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-02-16T16:01:47.585Z","etag":null,"topics":["entry","file","plugin","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/privatenumber.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":"2021-08-07T06:22:52.000Z","updated_at":"2021-08-10T20:36:15.000Z","dependencies_parsed_at":"2022-08-12T17:00:56.425Z","dependency_job_id":null,"html_url":"https://github.com/privatenumber/entry-file-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fentry-file-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fentry-file-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fentry-file-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fentry-file-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/privatenumber","download_url":"https://codeload.github.com/privatenumber/entry-file-plugin/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241698977,"owners_count":20005299,"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":["entry","file","plugin","webpack"],"created_at":"2024-10-11T00:45:27.654Z","updated_at":"2025-03-03T16:30:52.507Z","avatar_url":"https://github.com/privatenumber.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# entry-file-plugin \u003ca href=\"https://npm.im/entry-file-plugin\"\u003e\u003cimg src=\"https://badgen.net/npm/v/entry-file-plugin\"\u003e\u003c/a\u003e \u003ca href=\"https://npm.im/entry-file-plugin\"\u003e\u003cimg src=\"https://badgen.net/npm/dm/entry-file-plugin\"\u003e\u003c/a\u003e \u003ca href=\"https://packagephobia.now.sh/result?p=entry-file-plugin\"\u003e\u003cimg src=\"https://packagephobia.now.sh/badge?p=entry-file-plugin\"\u003e\u003c/a\u003e\n\nCreate an ESM entry-file in your Webpack build to consolidate entry-point exports\n\n\u003csub\u003eSupport this project by ⭐️ starring and sharing it. [Follow me](https://github.com/privatenumber) to see what other cool projects I'm working on! ❤️\u003c/sub\u003e\n\n## 🙋‍♂️ Why?\nFor consolidating exports from Webpack builds that emit multiple entry-points.\n\nA great use-case for this is Vue.js component builds that extract the CSS into a separate file. Even if the build bundles multiple components, by creating an entry-point that imports the CSS and re-exports the components, consuming applications can simply import from one path to get the appropriate styles.\n\n## 🚀 Install\n```sh\nnpm i -D entry-file-plugin\n```\n\n## 🚦 Quick setup\n\nIn `webpack.config.js`:\n\n```diff\n+ const EntryFilePlugin = require('entry-file-plugin')\n\n  module.exports = {\n    ...,\n\n    plugins: [\n      ...,\n+     new EntryFilePlugin({\n+       imports: [...], \n+       exports: [...]\n+     })\n    ]\n  }\n```\n\n### Example\nThe following configuration:\n```js\nnew EntryFilePlugin({\n  imports: [\n    './styles.css',\n  ],\n  exports: [\n    './components.js',\n  ],\n})\n```\n\nCreates an `index.js` file:\n```js\nimport \"./styles.css\";\nexport * from \"./components.js\";\n```\n\n## ⚙️ Options\n### filename\nType: `string`\n\nDefault: `index.js`\n\nThe entry file name.\n\n### imports\nType: `string[]`\n\n\nAn array of paths to import from.\n\n### exports\nType:\n\n```ts\ntype Specifier = (string | {\n  name: string;\n  as?: string;\n})[];\n\ntype Exports = (string | {\n  from: string;\n  specifiers?: Specifier[];\n})[];\n```\n\nAn array of paths and names to export from.\n\n### omitSourcesNotFound\nType: `boolean`\n\nDefault: `false`\n\nWhether to omit import/export statements for relative paths that could not be resolved. If `false`, a warning will be emitted for unresolvable import/exports.\n\n## 👨‍👩‍👧 Related\n\n- [rollup-plugin-aggregate-exports](https://github.com/privatenumber/rollup-plugin-aggregate-exports) - Similar plugin for Rollup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Fentry-file-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprivatenumber%2Fentry-file-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Fentry-file-plugin/lists"}