{"id":18336401,"url":"https://github.com/launchpadlab/dot-index-webpack-plugin","last_synced_at":"2025-04-09T19:55:41.630Z","repository":{"id":147464804,"uuid":"111144847","full_name":"LaunchPadLab/dot-index-webpack-plugin","owner":"LaunchPadLab","description":"Automatically build index.js files!","archived":false,"fork":false,"pushed_at":"2024-03-15T12:45:40.000Z","size":227,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-09T19:55:36.940Z","etag":null,"topics":[],"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/LaunchPadLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-17T19:54:47.000Z","updated_at":"2023-03-10T16:41:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a6ebb57-e054-42d2-af01-c4670a46ecf3","html_url":"https://github.com/LaunchPadLab/dot-index-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Fdot-index-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Fdot-index-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Fdot-index-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LaunchPadLab%2Fdot-index-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LaunchPadLab","download_url":"https://codeload.github.com/LaunchPadLab/dot-index-webpack-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103911,"owners_count":21048245,"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":[],"created_at":"2024-11-05T20:07:49.154Z","updated_at":"2025-04-09T19:55:41.598Z","avatar_url":"https://github.com/LaunchPadLab.png","language":"JavaScript","readme":"[![npm version](https://badge.fury.io/js/dot-index-webpack-plugin.svg)](https://badge.fury.io/js/dot-index-webpack-plugin)\n\n# dot-index-webpack-plugin\n\nThis plugin automatically builds [dot index files](#dot-index-files) that export the contents of directories. It generates these files each time a file is changed or added to a specified source folder. This relieves you of the need to remember to update your index files each time you add a new file to your project.\n\n## Dot Index Files\n\nDot index files are identical to index files except in name: the filename `.index.js` rather than `index.js` denotes that they were generated automatically. A dot index file exports all other modules in its directory, using the name of the file as the name of the export. For instance, in a directory with structure:\n\n```\n+ src\n| - .index.js\n| - myModule.js\n| - otherModule.js\n```\n\nThe .index.js file would look like:\n\n```js\nexport { default as myModule } from './myModule'\nexport { default as otherModule } from './otherModule'\n```\n\nThis convention means that it's important that filenames match desired module names. In order to use a custom index file rather than a generated one, simply add a `index.js` in the given directory.\n\n## Usage\n\nTo use this plugin in your project, add an instance of the plugin to your `plugins` array, with a `path` option value specifying the root of the directory where you'd like your dot index files to be generated.\n\nExample **webpack.config.js**:\n\n```js\nconst DotIndexPlugin = require('dot-index-webpack-plugin')\n\nmodule.exports = {\n  // ... other configuration ...\n  plugins: [\n    new DotIndexPlugin({\n      // watch src/ folder for changes\n      path: path.join(__dirname, '../src'),\n    }),\n  ],\n}\n```\n\n## Custom export names\n\nIn some cases, you may want to customize the formatting of the generated export names.\nIn this case, you can pass in a custom `formatExports` function to the plugin constructor:\n\n```js\n  plugins: [\n    new DotIndexPlugin({\n      path: path.join(__dirname, '../src'),\n      formatExports: (filename, rootPath) =\u003e filename.toUpperCase()\n    })\n  ],\n\n  // ... will result in ...\n\n  export { default as MYCOMPONENT } from './MyComponent'\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchpadlab%2Fdot-index-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaunchpadlab%2Fdot-index-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchpadlab%2Fdot-index-webpack-plugin/lists"}