{"_id":"webpack-disk-plugin","_rev":"80-355074e4b972cf630d90a29f07b0dc27","name":"webpack-disk-plugin","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"webpack-disk-plugin","version":"0.0.1","keywords":["webpack"],"author":{"name":"Ryan Roemer","email":"ryan.roemer@formidablelabs.com"},"license":"MIT","_id":"webpack-disk-plugin@0.0.1","maintainers":[{"name":"ryan.roemer","email":"ryan@loose-bits.com"}],"homepage":"https://github.com/FormidableLabs/webpack-disk-plugin#readme","bugs":{"url":"https://github.com/FormidableLabs/webpack-disk-plugin/issues"},"dist":{"shasum":"7fdb430ee2b5941f4352216d6052aa74578a7591","tarball":"https://registry.npmjs.org/webpack-disk-plugin/-/webpack-disk-plugin-0.0.1.tgz","integrity":"sha512-8dUJNjomQ+DYlntYkrfosz+G300WZQExlZP3a27RPrneOsWM7vGaiNv6vfBVtKlnwdBwimQzOQdygo8MdzeTsA==","signatures":[{"sig":"MEYCIQCrc/umu7Ihich3Lhbe0GvTWmugA20KHY1j7VJKAXJzagIhANQMOuFf7KQQAlnif51i38mAZ09R23/Ui+xvBOxhjtiP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"7fdb430ee2b5941f4352216d6052aa74578a7591","gitHead":"ade70380dd0d232b2d34dac8ad25ac030ac66548","scripts":{"lint":"eslint lib demo/*.js","test":"bash test/verify-builds.sh","check":"npm run lint && npm run test","clean":"rimraf demo/stats.json demo/build*","build-demo-wp":"npm run clean && cd demo && webpack","build-demo-wds":"npm run clean && cd demo && webpack-dev-server"},"_npmUser":{"name":"ryan.roemer","email":"ryan@loose-bits.com"},"repository":{"url":"git+https://github.com/FormidableLabs/webpack-disk-plugin.git","type":"git"},"_npmVersion":"2.14.12","description":"Webpack disk plugin","directories":{},"_nodeVersion":"4.3.2","dependencies":{"async":"^2.1.2","fs-extra":"^1.0.0"},"devDependencies":{"eslint":"^2.13.1","rimraf":"^2.5.4","webpack":"^1.13.3","webpack-dev-server":"^1.16.2","eslint-plugin-import":"^1.16.0","webpack-stats-plugin":"^0.1.4","eslint-plugin-filenames":"^1.1.0","eslint-config-formidable":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/webpack-disk-plugin-0.0.1.tgz_1478730937299_0.9389923368580639","host":"packages-12-west.internal.npmjs.com"}},"0.0.2":{"name":"webpack-disk-plugin","version":"0.0.2","keywords":["webpack"],"author":{"name":"Ryan Roemer","email":"ryan.roemer@formidablelabs.com"},"license":"MIT","_id":"webpack-disk-plugin@0.0.2","maintainers":[{"name":"ryan.roemer","email":"ryan@loose-bits.com"}],"homepage":"https://github.com/FormidableLabs/webpack-disk-plugin#readme","bugs":{"url":"https://github.com/FormidableLabs/webpack-disk-plugin/issues"},"dist":{"shasum":"2cba1e205c5a95d108870beabff0b47c7d7ec8af","tarball":"https://registry.npmjs.org/webpack-disk-plugin/-/webpack-disk-plugin-0.0.2.tgz","integrity":"sha512-s599SQaSRSGBEINvDINdRXUZtKqU4WBWGDrCUJI3A4Lfkl4af0cYArHliigENKEVwllfYNI+CChoez5M0VBclA==","signatures":[{"sig":"MEUCICJ1eaneD05UwEzk13xQnRsLTpoYCjjzW+Bn0sIRj2z7AiEAyMndjPZYj8cL59ZjOlD5h71kNnn0cfnljJ5OqIKHpQM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"lib/index.js","_from":".","_shasum":"2cba1e205c5a95d108870beabff0b47c7d7ec8af","gitHead":"275ade09890841435f61cfd0a4169e4e6f73a5d6","scripts":{"lint":"eslint lib demo/*.js","test":"bash test/verify-builds.sh","check":"npm run lint && npm run test","clean":"rimraf demo/stats.json demo/build*","build-demo-wp":"npm run clean && cd demo && webpack","build-demo-wds":"npm run clean && cd demo && webpack-dev-server"},"_npmUser":{"name":"ryan.roemer","email":"ryan@loose-bits.com"},"repository":{"url":"git+https://github.com/FormidableLabs/webpack-disk-plugin.git","type":"git"},"_npmVersion":"2.14.12","description":"Webpack disk plugin","directories":{},"_nodeVersion":"4.3.2","dependencies":{"async":"^2.1.2","fs-extra":"^1.0.0"},"devDependencies":{"eslint":"^2.13.1","rimraf":"^2.5.4","webpack":"^1.13.3","webpack-dev-server":"^1.16.2","eslint-plugin-import":"^1.16.0","webpack-stats-plugin":"^0.1.4","eslint-plugin-filenames":"^1.1.0","eslint-config-formidable":"^2.0.1"},"_npmOperationalInternal":{"tmp":"tmp/webpack-disk-plugin-0.0.2.tgz_1478776764869_0.9793068335857242","host":"packages-18-east.internal.npmjs.com"}}},"time":{"created":"2016-11-09T22:35:37.542Z","modified":"2026-07-20T21:17:20.387Z","0.0.1":"2016-11-09T22:35:37.542Z","0.0.2":"2016-11-10T11:19:26.845Z"},"bugs":{"url":"https://github.com/FormidableLabs/webpack-disk-plugin/issues"},"author":{"name":"Ryan Roemer","email":"ryan.roemer@formidablelabs.com"},"license":"MIT","homepage":"https://github.com/FormidableLabs/webpack-disk-plugin#readme","keywords":["webpack"],"repository":{"url":"git+https://github.com/FormidableLabs/webpack-disk-plugin.git","type":"git"},"description":"Webpack disk plugin","maintainers":[{"email":"sarahmichelleegan@gmail.com","name":"sarmeyer"},{"email":"mariano.martinez@formidable.com","name":"mariano-formidable"},{"email":"ryan@loose-bits.com","name":"ryan.roemer"},{"email":"admin@formidablelabs.com","name":"formidable-owner"},{"email":"npm@formidablelabs.com","name":"formidablelabs"},{"email":"sarah.wright@formidable.com","name":"sarahformidable"},{"email":"senesealessandro@gmail.com","name":"ceceppa"}],"readme":"Webpack Disk Plugin\n===================\n\n[![Build Status][trav_img]][trav_site]\n\nThis plugin will take an arbitrary Webpack compiler asset (e.g., a JS, CSS,\nHTML, or other plugin-generated file) and write it directly to disk.\n\nNormally this wouldn't be needed, but a specific good use case is when using\n`webpack-dev-server` that only has files available in memory over a network and\nyou need to access a real file on disk. Potential situations where this comes\nup is in development with a Node.js server on the backend that ingests a\nwebpack-produced file.\n\n## Installation\n\nThe plugin is available via [npm](https://www.npmjs.com/package/webpack-disk-plugin):\n\n```\n$ npm install --save webpack-disk-plugin\n```\n\n## Usage\n\nThe plugin hooks in to the\n[`after-emit`](https://webpack.github.io/docs/plugins.html#after-emit-async)\nevent and writes any specified assets to the real underlying file system.\n\n### Options\n\n* `output.path`: The base directory to write assets to. (Default: `\".\"`).\n* `files`: An array of objects to map an asset to a file path\n\nThe `files` array is composed of objects of the form:\n\n* `asset`: A regex or string to match the name in the webpack compiler.\n  Note that something like `[hash].main.js` will be _fully expanded_ to\n  something like `e49186041feacefb583b.main.js`.\n* `output`: An object with additional options:\n    * `path`: Override the top-level `output.path` directory to write too.\n    * `filename`: A specified filename to write to. Can be a straight string\n      or a function that gets the asset name to further mutate. Also may be\n      a single filename, a relative path to append to the base `path`, or an\n      absolute path.\n\n### Notes\n\n* **Can only have 1 unique output path**: 2+ files cannot target the same full\n  file path. At the same time, you _can_ have 2+ _input_ asset matches.\n\n## Examples\n\nAdditional examples are provided in:\n[`demo/webpack.config.js`](demo/webpack.config.js). If you have a clone of this\nrepository with `devDependencies`, you can run:\n\n```sh\n# Output using `webpack`\n$ npm run build-demo-wp\n\n# Output using `webpack-dev-server`\n$ npm run build-demo-wds\n```\n\nand see the results in the [`demo`](demo) directory.\n\n### Basic\n\nHere's a basic use case that copies and renames one file.\n\n```js\nvar DiskPlugin = require(\"webpack-disk-plugin\");\n\nmodule.exports = {\n  plugins: [\n    // Everything else **first**.\n\n    // Write out asset files to disk.\n    new DiskPlugin({\n      output: {\n        path: \"build\"\n      },\n      files: [\n        { asset: \"stats.json\" },\n        { asset: /[a-f0-9]{20}\\.main\\.js/, output: { filename: \"file.js\" } }\n      ]\n    }),\n  ]\n}\n```\n\n### Advanced\n\nHere's an advanced use case that has nested directories and functionally renames\nfiles:\n\n```js\nvar DiskPlugin = require(\"webpack-disk-plugin\");\n\nmodule.exports = {\n  plugins: [\n    // Everything else **first**.\n\n    // Write out asset files to disk.\n    new DiskPlugin({\n      output: { path: \"build\" },\n      files: [\n        { asset: \"stats.json\", output: { filename: \"nested/stats.json\" } },\n        {\n          asset: /[a-f0-9]{20}\\.main\\.js/,\n          output: {\n            // Custom namer: invert the hash.\n            filename: function (name) {\n              return \"main.\" + name.match(/[a-f0-9]{20}/)[0] + \".js\";\n            }\n          }\n        }\n      ]\n    }),\n  ]\n}\n```\n\n## Contributions\n\nContributions welcome! Make sure to pass `$ npm run check`.\n\n[trav]: https://travis-ci.org/\n[trav_img]: https://api.travis-ci.org/FormidableLabs/webpack-disk-plugin.svg\n[trav_site]: https://travis-ci.org/FormidableLabs/webpack-disk-plugin\n","readmeFilename":"README.md","users":{"monkeykode":true}}