{"id":21937432,"url":"https://github.com/packingjs/packing-rev-webpack-plugin","last_synced_at":"2026-04-05T22:02:21.929Z","repository":{"id":57317861,"uuid":"62714866","full_name":"packingjs/packing-rev-webpack-plugin","owner":"packingjs","description":null,"archived":false,"fork":false,"pushed_at":"2017-06-08T04:38:18.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T23:48:27.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/packingjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-06T11:08:50.000Z","updated_at":"2017-06-08T04:14:47.000Z","dependencies_parsed_at":"2022-08-25T21:12:13.979Z","dependency_job_id":null,"html_url":"https://github.com/packingjs/packing-rev-webpack-plugin","commit_stats":null,"previous_names":["zhongzhi107/packing-rev-webpack-plugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packingjs%2Fpacking-rev-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packingjs%2Fpacking-rev-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packingjs%2Fpacking-rev-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/packingjs%2Fpacking-rev-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/packingjs","download_url":"https://codeload.github.com/packingjs/packing-rev-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244967615,"owners_count":20539986,"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-29T01:19:45.295Z","updated_at":"2025-12-30T23:47:00.697Z","avatar_url":"https://github.com/packingjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Packing Rev Webpack Plugin\n\n[![NPM](https://nodei.co/npm/packing-rev-webpack-plugin.png)](https://nodei.co/npm/packing-rev-webpack-plugin/)\n\nThis is a [webpack](http://webpack.github.io/) plugin that reversion files to the build directory.\n\n### Getting started\n\nInstall the plugin:\n\n```\nnpm install --save-dev packing-rev-webpack-plugin\n```\n\n### Usage\n\n`new RevWebpackPlugin([patterns], options)`\n\nnew RevWebpackPlugin({\n      cwd: path.join(cwd, assets),\n      src: '**/*.{jpg,png}',\n      dest: path.join(cwd, assetsDist),\n    }),\n\nA pattern looks like:\n`{ cwd: '', src: '**/*', dest: 'dest' }`\n\n#### Pattern properties:\n* `src`\n    - is required\n    - can be a glob\n    - can be an Array\n* `dest`\n    - is optional\n    - if not absolute, it's relative to the build root\n* `cwd`\n    - is optional\n    - The base directory (absolute path!) for reversion\n    - defaults to process.cwd()\n* `glob`\n    - is optional\n    - [glob](https://github.com/isaacs/node-glob) options\n\n#### Available options:\n* `format`\n    - is optional\n    - reversion name format\n    - default value is `[name]-[hash][ext]`\n* `algorithm`\n    - is optional\n    - default value is `sha256`\n* `length`\n    - is optional\n    - default value is `8`\n\n### Examples\n\n```javascript\nvar RevWebpackPlugin = require('packing-rev-webpack-plugin');\nvar path = require('path');\n\nmodule.exports = {\n    plugins: [\n        new RevWebpackPlugin([\n            { src: 'from/file.txt', dest: 'dist' },\n\n            // {output}/to/file.txt\n            { cwd: 'assets', src: 'images/**/*', dest: 'imgs' }\n        ]),\n        new RevWebpackPlugin([\n            { src: ['**/*.png', '!notrev.png'], dest: 'dist' },\n\n            // {output}/to/file.txt\n            { cwd: 'assets', src: 'images/**/*', dest: 'imgs' }\n        ])\n    ]\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpackingjs%2Fpacking-rev-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpackingjs%2Fpacking-rev-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpackingjs%2Fpacking-rev-webpack-plugin/lists"}