{"id":13671299,"url":"https://github.com/deepak/clean-entry-webpack-plugin","last_synced_at":"2025-04-27T14:33:17.743Z","repository":{"id":57199740,"uuid":"131580422","full_name":"deepak/clean-entry-webpack-plugin","owner":"deepak","description":"A webpack plugin to remove unwanted files which may have been created and output due to multiple entry points","archived":false,"fork":true,"pushed_at":"2018-04-30T10:42:33.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T17:36:48.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"AnujRNair/webpack-extraneous-file-cleanup-plugin","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepak.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-04-30T09:59:32.000Z","updated_at":"2021-02-15T22:00:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/deepak/clean-entry-webpack-plugin","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/deepak%2Fclean-entry-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepak%2Fclean-entry-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepak%2Fclean-entry-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepak%2Fclean-entry-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepak","download_url":"https://codeload.github.com/deepak/clean-entry-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251154436,"owners_count":21544500,"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-08-02T09:01:05.444Z","updated_at":"2025-04-27T14:33:17.416Z","avatar_url":"https://github.com/deepak.png","language":"JavaScript","readme":"# Clean Entry Webpack Plugin\n\nA webpack plugin to remove unwanted files which may have been created and output due to multiple entry points\n\nThis plugin supports only `webpack@4` aka the latest and the greatest.\n\n## Problem\n\nI have generally used Webpack with a `javascript` entry point. But this is not\nmandatory.\n\nWebpack can have a css, sass or postcss entry point. Maybe others types as well,\nbut I have not checked. However, one problem with a non-javascript entry point\nis that the postcss entry will still output a javascript file.\n\nEven with specifying Webpack's `output.filename` as `[name]-[hash].css`\ngenerates a javascript file with a mis-named css extension.\nAnd `ExtractTextPlugin` solves it by extracting the css file from the bundle\nbut the javascript file still remains.\n\nThis is of particular interest, for css-only Webpack builds ie. using Webpack\nwhere we might have used Gulp in the past.\n\nThis plugin removes:\n\n1. javascript files for entries\n2. references to (1) above from `manifest.json`, if you are using the [webpack-manifest-plugin](https://github.com/danethurber/webpack-manifest-plugin)\n3. sourcemap files for entries\n\n## Usage\n\nInstall using `npm` or `yarn`\n```js\nnpm install clean-entry-webpack-plugin --save-dev\nyarn add clean-entry-webpack-plugin --dev\n```\n\nIn your `webpack.config.js` file:\n\n```js\nconst CleanEntryPlugin = require('clean-entry-webpack-plugin');\n\nmodule.exports = {\n  ...\n  plugins: [\n    new CleanEntryPlugin()\n  ]\n}\n```\n\n## All Configuration Options\n\nThe CleanEntryPlugin accepts an object of options with the following attributes:\n\n```js\nnew CleanEntryPlugin({\n  manifestPath: path.join(path.resolve(__dirname, 'data'), 'manifest.json')\n  verbose: true\n})\n```\n\n* `entries` - a list of entries to clean. defaults to all of Webpack's entries.\n* `manifestPath` - full path to the `manifest.json` file (not relative), if any. Build does not fail if path does not exist.\n* `verbose` - log which files are deleted. defaults to false.\n* `dryRun` - do not actually delete any files. assumes `verbose`. defaults to false\n\n## Development\n\n[brew](https://brew.sh/) works on OSX and Linux\n\n```sh\nbrew install yarn git-hooks\ngit hooks --install\necho \"to test commit message without actually commiting\" | commitlint\n# inside this plugin\nyarn link\n# in your webpack project\nyarn link \"clean-entry-webpack-plugin\"\n```\n\n## TODO\n\n- have tried only with `webpack-manifest-plugin`. how to handle other alternatives ?\n- add tests\n- tested on OSX. need to test on Windows\n- supports only webpack 4\n- annotate options with typescript\n\n## CREDITS\n\n- forked code from https://github.com/AnujRNair/webpack-extraneous-file-cleanup-plugin\n  Anuj's code deals with the actual files, extension globs and min-size but this fork\n  has Webpack's entry as the abstraction not the actual files. Also we do not care about min-size.\n- webpack@4 support from https://github.com/bookwyrm/webpack-extraneous-file-cleanup-plugin/tree/webpack4","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepak%2Fclean-entry-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepak%2Fclean-entry-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepak%2Fclean-entry-webpack-plugin/lists"}