{"_id":"generate-file-webpack-plugin","_rev":"5-e645b6ce1320c9f8c87ded4a3a99f474","name":"generate-file-webpack-plugin","dist-tags":{"latest":"1.0.1"},"versions":{"0.0.1":{"name":"generate-file-webpack-plugin","version":"0.0.1","description":"General purpose Webpack plugin for generating files","main":"dist/index.js","scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/kflGALORE/generate-file-webpack-plugin.git"},"author":{"name":"kflGALORE"},"license":"MIT","devDependencies":{"@types/webpack":"^4.41.8","typescript":"^3.8.3","webpack":"^4.42.1"},"gitHead":"5217f73326f3b8ad6edbd3288a664a77f3d944dd","bugs":{"url":"https://github.com/kflGALORE/generate-file-webpack-plugin/issues"},"homepage":"https://github.com/kflGALORE/generate-file-webpack-plugin#readme","_id":"generate-file-webpack-plugin@0.0.1","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Qv/5ONUgGhI5ijTAofrgxfrmN+N5ZxUqUun/OUNV6nKefoGkkU+vct47eH/xf5AiRnmytJrLv5W/Mqfqh6CWxA==","shasum":"2bcb234be97f9fb611acabfb167e384b0f9cc51e","tarball":"https://registry.npmjs.org/generate-file-webpack-plugin/-/generate-file-webpack-plugin-0.0.1.tgz","fileCount":6,"unpackedSize":2840,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee46kCRA9TVsSAnZWagAAdYEP/0KeDnLEPbtB9WrnDz3e\n4/4lcCsKe8LY7cwUZOGyLn7gflRTlyMAt2snOkKntKkn2BvppNGC06t4jUE7\nvBSW+i5opQolaTwfKi/b77Jc+t7IYTayQ5UTUMJot5GV4FKpFmHJF3jnj6Oq\nPIi9MlKQ3tpK5Py+uE5TIk1S4r9JOmKR/15WBFY3/ryats5iONExypBpHe0u\nMk8xP7fdaRhyz18Q3HSk3X9e8dIpJOsIGG8qoc7vRNZz1dM9sBhloHuLiDqI\noLrFawZRwYdHz7Bhy/bDLQUW6hn63HtYjz8DZvieqDifj4WDB1srvdn3YZ/t\n6RSKaCfCMDtFiUi4GNw2AEXbYWEyeSy4F5/TAHP5kSPRLM094yby1sBL4cJ+\nokpXoKqigAcPQOmqvtQgilUztp+OnMp0q8uyNM3Kniw5XrV4xHlx3vsLrFGj\n6OhEfgonVqUaRs4TIuddZVH8Qx0RbhG1+esbyinc8cH7zP0HGrfxE493mSP2\n0iAJTTb7j7Scy9IzQhl9427HDqnMiN0tg3MPK9qpQ/UFn8R0GVdA5XAg2B0d\nPXh0CWqxgl6i5Dmmr+eeGy2Srxdl0mrihMNu9kzGOx2W/MIN1SPq6aa1Aw1h\n31lfsOuwzqLR8IOOf6+WvwXmeKB542lJhKEU19pX82M13iq7UoiL/R3TNcx1\nRyvB\r\n=o6Aa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2LIrLEoLESdmN7z0zQuuXed0g7O0VHz+A0tEWw6QmhAIhAJ8XhzHwBv1lMHHyMmcEXPED7Gj03KDDnVTdOcNLbnmu"}]},"maintainers":[{"name":"kflgalore","email":"kflgalore@gmail.com"}],"_npmUser":{"name":"kflgalore","email":"kflgalore@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/generate-file-webpack-plugin_0.0.1_1585155747676_0.31922121151222194"},"_hasShrinkwrap":false},"0.0.2":{"name":"generate-file-webpack-plugin","version":"0.0.2","description":"General purpose Webpack plugin for generating files","main":"lib/index.js","scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/kflGALORE/generate-file-webpack-plugin.git"},"author":{"name":"kflGALORE"},"license":"MIT","devDependencies":{"@types/webpack":"^4.41.8","typescript":"^3.8.3","webpack":"^4.42.1"},"gitHead":"8567464885b9fcacf31cbc5bd4356027db823efb","bugs":{"url":"https://github.com/kflGALORE/generate-file-webpack-plugin/issues"},"homepage":"https://github.com/kflGALORE/generate-file-webpack-plugin#readme","_id":"generate-file-webpack-plugin@0.0.2","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-40rIJC52a7WlyUA6SHjFy6TcEtafUfzhZXltL8yzpcMHTx31P/ir50PYJdNy/SK7pl/uxqeUxgz0OTji916kiQ==","shasum":"40396d1dbbf6dd492f00bdbef0ccc9cb12be59f3","tarball":"https://registry.npmjs.org/generate-file-webpack-plugin/-/generate-file-webpack-plugin-0.0.2.tgz","fileCount":9,"unpackedSize":3441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee5aECRA9TVsSAnZWagAAPT8QAI53+T7O92TfSws2dH2A\naOpnw9vvKAvCQrYPiouXX5BUB4tgdDCAvGtByM2UXETZrVYDC47cUm8vQ7AA\n/gHhxIri+J4TQfYVmBirfmNf+1bm4zSlrRBOOymtDiCKvJCiiORXzjoTpz8p\nCLPpIb7zTeoQwDKCzaJ3dsdHNYBQBP2uBRqh4JOaxsBNBf078flh5PSvnDiw\nyqd2ATbJBGP0T3WYtFZ3Nd3B525sqYpWXIsMR4QW6h/zUKyOYZcMTqIN5oMr\nXKCVL3TLg4tgo4VeyYxa+9FhEhrrjukkBLIPLwnKScUCYXTT8hSaMqh8rkEo\ncAXJ+0hLpBZutZrqjYkKmGdU86KrOpshIavKO++o053NJtR3vFA20wSlfzzd\nHQewTkcXhtrGYbw0JGGeVK9JzjYmOM+rUbhnbyI5HeIfHEQ3GKtcD1benP8W\ntpzrxL2NRKOnwppK7J4GpbxcSmIVmICaYz0OEDAImBZpAHrRadZlJ71DMblG\n8UmOriotufoT2TNxNkTzUVCj8IxZJ914Ugu0naUclh51rtDiqamiudZKaHmR\nESa8RB+mDPR68rOgaOGUFGgkKl7ZtjNiMO9nwobIi8FsqiTH5Fj6xVigNmKi\n/lsMOxTC5liCRQLo+3U5AFa7a/en6i0do+s1pdGh2dgXfJ3Rsj6AIWOrbJJ9\ncucl\r\n=+JeD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH1pSH7w4QmoyxTJiPCgj3O7g/o3lxBLrFEBRH/DFpTGAiEAx3ADRMyeW0FT/HJlNngsVH1PJyml4b+Ol4ZAa89zTVI="}]},"maintainers":[{"name":"kflgalore","email":"kflgalore@gmail.com"}],"_npmUser":{"name":"kflgalore","email":"kflgalore@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/generate-file-webpack-plugin_0.0.2_1585157763785_0.501319216366104"},"_hasShrinkwrap":false},"0.0.3":{"name":"generate-file-webpack-plugin","version":"0.0.3","description":"General purpose Webpack plugin for generating files","main":"lib/index.js","scripts":{"build":"tsc","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/kflGALORE/generate-file-webpack-plugin.git"},"author":{"name":"kflGALORE"},"license":"MIT","devDependencies":{"@types/webpack":"^4.41.8","typescript":"^3.8.3","webpack":"^4.42.1"},"gitHead":"86855a462fb47280be0698c9b55a3e9155741553","bugs":{"url":"https://github.com/kflGALORE/generate-file-webpack-plugin/issues"},"homepage":"https://github.com/kflGALORE/generate-file-webpack-plugin#readme","_id":"generate-file-webpack-plugin@0.0.3","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-4Ti9d3OMVbtmN7ia9nCEq7PT0891nk/4ra+v2Y+Rs1b4tFvR5O8fR4q/59AmgjPr4JUyQzPWOJpnFthUTZh+nQ==","shasum":"609aedaec6ff50a1286f829bd444a7bb6f8437ca","tarball":"https://registry.npmjs.org/generate-file-webpack-plugin/-/generate-file-webpack-plugin-0.0.3.tgz","fileCount":4,"unpackedSize":2287,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJee6IbCRA9TVsSAnZWagAAfJ8P/2fpJoN3NfkuByppYbLT\n0Irt7fSUtgocUlMI/vryktIB1LDxyfRhg8kMaOKDnWPClfRcpfa6t71/xy7S\nTtzNyBEkpiItwZqvmjvHMyRMyiLpoPk4rC2WV/WkbEIB1zK9BPK1e+4dmvfn\n/05CC6ojUyChMqu0yikfNYqJ9xGmGnGO0kGP84cviJgmqxzuCuy4skB0qOkW\nRIQ/tCtfRXvqdovVMYEr9q8PTAHt0TaOWb95vnaeUT0elDlBOzLHnoBbObZ1\nAzxThVfxZcQubLagLXBLwiiit6rzU9FAjGXjhrsIS2eTEzdSI5KSz3V7Hpg3\nov7r4kcriF7Qx8pfvTJmxyVATSp+JPR1RlcbHFZVmmaoJQGNNGEYYqresrk/\nEOWhGLQUPsJ+/96bQBIvbLESDX4z05DFFthHGCnN2mW4hBnVWyYpfPqMYMLy\nzmdydJ6wDlo6CRESjc8krsqW34xzQVbU4ot1/YOuilhash9ZL9xMpKIbmRnf\nyAh2cKtRKgjglclsYvLPNUqoQGLDw5Lu8PccpojtWAoAI6KwqhQHXf9G9AZX\nTagSFwZ7mRQs9m1o+8OEgNQEsOdluuUhRnwpRO7mRzlQwFIAlUbQV34Mzxa3\np6eofAPTIAyO8d7dpoGJSPlKJcsbhqeVkbZz7vpBF9YMPUUMGcGMe3gxJevd\nZ/dL\r\n=qVFh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAEj+dVN+XTN0t76JHYNg/QvABUpM+GZ7g1Qfw9qrPzTAiAdf/wmD1fHf4e5MmBBrBZbjFnIGOlwFSi1SXzsDP3ljw=="}]},"maintainers":[{"name":"kflgalore","email":"kflgalore@gmail.com"}],"_npmUser":{"name":"kflgalore","email":"kflgalore@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/generate-file-webpack-plugin_0.0.3_1585160731122_0.8320633372303465"},"_hasShrinkwrap":false},"1.0.0":{"name":"generate-file-webpack-plugin","version":"1.0.0","description":"General purpose Webpack plugin for generating files.","main":"lib/index.js","scripts":{"build":"tsc","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/kflGALORE/generate-file-webpack-plugin.git"},"author":{"name":"kflGALORE"},"license":"MIT","keywords":["webpack","plugin","webpack-plugin","generate","generator","file","files","create","creator","generic","general-purpose","helper","util"],"devDependencies":{"@types/jest":"^25.1.4","@types/rimraf":"^3.0.0","@types/webpack":"^4.41.8","jest":"^25.2.2","rimraf":"^3.0.2","ts-jest":"^25.2.1","typescript":"^3.8.3","webpack":"^4.42.1"},"gitHead":"10669581d96b7ac8c0fca4d22e6f060f53394968","bugs":{"url":"https://github.com/kflGALORE/generate-file-webpack-plugin/issues"},"homepage":"https://github.com/kflGALORE/generate-file-webpack-plugin#readme","_id":"generate-file-webpack-plugin@1.0.0","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-2vy+wvWkpjenmsHrxY/YBwpQOwlwq/5GiwZ/b9zmdhFXc2mmny1kYS5AJD/AlVRu9oKkNGDwHSCbZDgXkr2Yog==","shasum":"8fc5a44132b7da3cb2765b728cd41b6ccd9c2cde","tarball":"https://registry.npmjs.org/generate-file-webpack-plugin/-/generate-file-webpack-plugin-1.0.0.tgz","fileCount":4,"unpackedSize":23555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoewECRA9TVsSAnZWagAAKx8QAJBMHogouYJaPHdtjBY4\nxCjZSsxA3B851WeuCiXZup0LAxYjEO3wibza2hfArgcfzwY0b4d7fUvi92lr\nTzE0bRZuXq0uSnpo6nr9i0La0YpSqq8r6qRuDkC7YEoOE8PVJZsbuFspcElV\n1EFjANoBLE+6VozwQE6WLD8nyZKqHGiB6qgH8FksedeYH30ZpyY97ygtVKvv\nM2hTFlQE8IcfaBartrIJ4oWix0EZ1naxANgBK7DbIistsEQK5r+FISMK2YM+\nwn980sE+/AhMq0JZsEAmg42b9Js53Fz2gFWcs2/QbAXOZ9X9RgzGmhv00z02\nYdKfkYzpdTqt+XmAWCi+XEMTbVzY3FxwH7IE+jwLE/TPK5EFuHqBqS+DOgAi\nwx5y2ENoNBb0LU/4n3tLfQI4xLgSZQr3nNsj8drQB6xWbBqCNFwqZpkmgjhP\nk2F8KGECUxiNOXXsaSQPx+6BSSbk98U/m4FeIOicaqvjFpUhVIQ3tLDpl0Tg\nMZsZHpa8J4xcuwcMLUEYqPeneWzptCx+h9RNwex6GDYO11JKsg2/rJNPvprC\n1vMJXizFxTu8IoesfSfvV3s97dTqWiUSCt4PZLfkUYPLyXaNJwTMf2IEuYgl\n02r9g6VGydtrxbntBG/ASDwcblijVDbJnQYZipBH/KWnvHT7edHHTqjr1/GK\nMDqh\r\n=dOJz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDH/UgHjzdkeXVkG3qO4Zmjb/bZ/jDEaRSsycBiAwZK1wIhANS5/pWx5AKPlNFNBS+pXAFmL+rCvgHduNrzlrZobvf2"}]},"maintainers":[{"name":"kflgalore","email":"kflgalore@gmail.com"}],"_npmUser":{"name":"kflgalore","email":"kflgalore@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/generate-file-webpack-plugin_1.0.0_1587670019857_0.6670165805198687"},"_hasShrinkwrap":false},"1.0.1":{"name":"generate-file-webpack-plugin","version":"1.0.1","description":"General purpose Webpack plugin for generating files.","main":"lib/index.js","scripts":{"build":"tsc","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/kflGALORE/generate-file-webpack-plugin.git"},"author":{"name":"kflGALORE"},"license":"MIT","keywords":["webpack","plugin","webpack-plugin","generate","generator","file","files","create","creator","generic","general-purpose","helper","util"],"devDependencies":{"@types/jest":"^25.1.4","@types/rimraf":"^3.0.0","@types/webpack":"^4.41.8","jest":"^25.2.2","rimraf":"^3.0.2","ts-jest":"^25.2.1","typescript":"^3.8.3","webpack":"^4.42.1"},"gitHead":"49ed80c0b4cfe0d21309c3e92fb1092ea72be7d2","bugs":{"url":"https://github.com/kflGALORE/generate-file-webpack-plugin/issues"},"homepage":"https://github.com/kflGALORE/generate-file-webpack-plugin#readme","_id":"generate-file-webpack-plugin@1.0.1","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-HSZjlNKQWWtIGKwm+oFvhqVYRhED3Ox21ls7XcSEb0EkUrNnzSz1GBZd6/UY+l/MbThpJyPAKNLenvWDUPhfMw==","shasum":"af0181050c119594fdf48248bdfa05f4952d2072","tarball":"https://registry.npmjs.org/generate-file-webpack-plugin/-/generate-file-webpack-plugin-1.0.1.tgz","fileCount":4,"unpackedSize":23499,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoe1JCRA9TVsSAnZWagAANywP/2eXl7fraGXBqxM8Vloo\nk0Jda1tqPvoJ88mBBjLSM83Z+YsQ9W16OvcJcCqNpPkPndCa6lA5Emxppi4T\nqqUa5oNo/Km5ZmOSBq2k+8wRRbQ2HGykTPOu269RT3SO0OelERyzkHgccRwS\nizYSgWWKKBMTDgbgPjEycWI0DzxXR5gf3SFtiAVAKu7QoRpVpudQaIpTuWnb\nv/C27ZVdUT6JtOO4mfD68NX/JRPlzC9qDs5HKaOB/eNva/cwgqmXsj1evFKq\naYKPIuKpwYIGtMcbPfZZc8F1bI5vWVG1o4dwaNcIRACPu5qakp6eRzimMGUJ\nbpuO9OFJDRkEzBDB18/J93kpEIVe2s+8Xwl9PaSBjmMRs87cMGhAoHsRtnqs\nzbJdhubLD4Evau5tNiAdtOba+UxdhSky8Iie21cFlBL0ZAxxne0Cgk91xZXL\ndAk+Qth7O0Eb0mavsO5yxt+d6xgspJCznXx1zfQn2C7HpfRPjimbaWrz/Y77\nV7G2mAbRNQcREIYKZsZrR49HcKMmlem+lCDpPERSEONJOlG/JWWC3MB9jYBv\ndm576//8G9FIODVo1SFhD0xsofD//S9OnMbJ6VV3umVvu3APA8P0tbtNj898\npSMi4+O8EnKD8EswUvfSCXjI53MEXDScKjufAjFQqh9SlPr0ep7NeJkUhR37\ndi7H\r\n=xhUa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPkN7Z2666xlq9kuyFQKElRaILX5l9H6OrOCaB24OCLgIhALVH05YG/2OpaijBhYBM0SBrBHBDNDRgvspbe7o/eX5j"}]},"maintainers":[{"name":"kflgalore","email":"kflgalore@gmail.com"}],"_npmUser":{"name":"kflgalore","email":"kflgalore@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/generate-file-webpack-plugin_1.0.1_1587670344499_0.7661762716379468"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-25T17:02:27.675Z","0.0.1":"2020-03-25T17:02:27.866Z","modified":"2022-05-03T07:27:36.075Z","0.0.2":"2020-03-25T17:36:03.926Z","0.0.3":"2020-03-25T18:25:31.242Z","1.0.0":"2020-04-23T19:26:59.965Z","1.0.1":"2020-04-23T19:32:24.673Z"},"maintainers":[{"name":"kflgalore","email":"kflgalore@gmail.com"}],"description":"General purpose Webpack plugin for generating files.","homepage":"https://github.com/kflGALORE/generate-file-webpack-plugin#readme","repository":{"type":"git","url":"git+https://github.com/kflGALORE/generate-file-webpack-plugin.git"},"author":{"name":"kflGALORE"},"bugs":{"url":"https://github.com/kflGALORE/generate-file-webpack-plugin/issues"},"license":"MIT","readme":"[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\r\n![CI (master)](https://github.com/kflGALORE/generate-file-webpack-plugin/workflows/CI%20(master)/badge.svg?branch=master)\r\n[![dependencies](https://david-dm.org/kflGALORE/generate-file-webpack-plugin.svg)](https://david-dm.org/kflGALORE/generate-file-webpack-plugin)\r\n[![dev-dependencies](https://david-dm.org/kflGALORE/generate-file-webpack-plugin/dev-status.svg)](https://david-dm.org/kflGALORE/generate-file-webpack-plugin#info=devDependencies)\r\n\r\n# generate-file-webpack-plugin\r\n\r\nGeneral purpose Webpack plugin for generating files.\r\n\r\n* [Getting Started](#getting-started)\r\n    * [Requirements](#getting-started--requirements)\r\n    * [Install](#getting-started--install)\r\n    * [Usage](#getting-started--usage)\r\n* [Configuration](#configuration)\r\n    * [file](#configuration--file)\r\n    * [content](#configuration--content)\r\n    * [debug](#configuration--debug)\r\n* [Examples](#examples)\r\n    * [Copy File](#examples--copy-file)\r\n    * [Generate Application Info](#examples--generate-app-info)\r\n    * [Using Handlebars Templates](#examples--using-handlebars-templates)\r\n    * [Generate Multiple Files](#examples--generate-multiple-files)\r\n* [Known Problems](#known-problems)\r\n\r\n\r\n<a name=\"getting-started\"></a>\r\n## Getting Started\r\n\r\n<a name=\"getting-started--requirements\"></a>\r\n### Requirements\r\n\r\n* Webpack 4.x\r\n  * Earlier version of Webpack probably won't work.\r\n  * Latest version 5.x may work, but has not been tested.\r\n  \r\n* Node.js 12.x\r\n  * Earlier versions may also work, but have not been tested.\r\n  * Later versions most probably also work, but have not been tested.\r\n\r\n* npm 6.x\r\n  * Earlier versions may also work, but have not been tested.\r\n  * Later versions most probably also work, but have not been tested.\r\n\r\n<a name=\"getting-started--install\"></a>\r\n### Install\r\n\r\nUsing npm:\r\n\r\n```bash\r\nnpm install generate-file-webpack-plugin --save-dev\r\n```\r\n\r\nEven if not been tested yet, installation using [yarn](https://classic.yarnpkg.com/en/) should work without problems:\r\n\r\n ```bash\r\n yarn add generate-file-webpack-plugin --dev\r\n ```\r\n\r\n<a name=\"getting-started--usage\"></a>\r\n### Usage\r\n\r\n**webpack.config.js**\r\n```javascript\r\nconst generate = require('generate-file-webpack-plugin');\r\n\r\nmodule.exports = {\r\n    // ...\r\n    plugins: [\r\n       generate({\r\n            file: 'output.txt',\r\n            content: 'Hello World'\r\n        })\r\n    ]\r\n};\r\n```\r\n\r\nRunning `webpack` via your preferred method will generate a file named `output.txt` in your root output directory with\r\nthe content `Hello World`.\r\n\r\n<a name=\"configuration\"></a>\r\n## Configuration\r\n\r\n**webpack.config.js**\r\n```javascript\r\nconst generate = require('generate-file-webpack-plugin');\r\n\r\nmodule.exports = {\r\n    // ...\r\n    plugins: [\r\n       generate(options)\r\n    ]\r\n};\r\n```\r\n\r\nThereby, `options` is the main configuration object for this plugin, supporting the following properties:\r\n\r\n<a name=\"configuration--file\"></a>\r\n#### `file`\r\n\r\nThe file that is to be generated. \r\n\r\nThis may either be a relative or an absolute file path. In case it is a relative file path, it will be resolved\r\n relative to the `output.path` you specified in your webpack configuration.\r\n\r\n* type: `string`\r\n* required: true\r\n* since: 1.0.0\r\n\r\n<a name=\"configuration--content\"></a>\r\n#### `content`\r\n\r\nThe content to be written into the specified `file`. \r\n\r\nThis property is designed to be quite flexible, in order to cover as much use cases as possible. In its simplest form \r\nit is just a `string` or a `Buffer`. But it may also be a `Promise` that will later resolve to either a `string` or a \r\n`Buffer`. Further, it may be a `Function` that either returns a  `string` or a `Buffer`, or a `Promise` resolving to one\r\nof the aforementioned types.\r\n\r\n* type: `string` \r\n| [`Buffer`](https://nodejs.org/api/buffer.html#buffer_class_buffer) \r\n| [`Promise<string>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) \r\n| [`Promise<Buffer>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) \r\n| `Function`\r\n* required: true\r\n* since: 1.0.0\r\n\r\n<a name=\"configuration--debug\"></a>\r\n#### `debug`\r\n\r\nFlag, indicating if additional debug output should be logged.\r\n\r\n* type: `boolean`\r\n* required: false\r\n* default: `false`\r\n* since: 1.0.0\r\n\r\n<a name=\"examples\"></a>\r\n## Examples\r\n\r\n<a name=\"examples--copy-file\"></a>\r\n### Copy File\r\n\r\nGiven, you have a `file my-file.txt` in your `src` directory. Then you can copy that file into webpack's default output\r\ndirectory like this:\r\n\r\n```javascript\r\nconst fs = require('fs');\r\nconst generate = require('generate-file-webpack-plugin');\r\n\r\nmodule.exports = {\r\n    // ...\r\n    plugins: [\r\n       generate({\r\n            file: 'my-file.txt',\r\n            content:  fs.readFileSync(path.resolve(__dirname, 'src/my-file.txt'))\r\n        })\r\n    ]\r\n};\r\n```\r\n\r\nNote, that this plugin's intend is _not_ to replace the well known \r\n[copy](https://github.com/webpack-contrib/copy-webpack-plugin) webpack plugin. In case you just want to copy over some\r\nfile into webpack's output directory, you'll probably be better suited to use the copy-webpack-plugin, since it may be\r\neasier to use for this case.\r\n\r\nNevertheless, this plugin got some features, that make it extremely useful in more complex scenarios as described in the \r\nfollowing examples.\r\n\r\n<a name=\"examples--generate-app-info\"></a>\r\n### Generate Application Info\r\n\r\nSay, you want to generate some metadata information for your app, that is to served by a web server and displayed in \r\nyour application on demand, you can do it like this:\r\n\r\n```javascript\r\nconst fs = require('fs');\r\nconst path = require('path');\r\nconst generate = require('generate-file-webpack-plugin');\r\n\r\n// Load package.json as object\r\nconst appPackage = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json')).toString());\r\n\r\nmodule.exports = {\r\n    // ...\r\n    plugins: [\r\n        generate({\r\n            file: 'app-info.js',\r\n            content: `const appInfo = {\r\n                name: \"${appPackage.name}\",\r\n                version: \"${appPackage.version}\"\r\n            }`\r\n        })\r\n    ]\r\n};\r\n```\r\n\r\nThis will generate a file `app-info.js` with the name and the version of the app, that can be served and included by \r\nyour web application, using the following tag:\r\n\r\n```html\r\n<script type=\"text/javascript\" language=\"javascript\" src=\"app-info.js\"></script>\r\n```\r\n\r\nNote, that this approach of specifying the content of the generated file as a (template) string has several drawbacks:\r\n* The `package.json` object is created as a global variable.\r\n* The content will be resolved as soon as the webpack configuration is loaded, and not at the time the \r\n  plugin is actually executed. This is OK in this case, but there may be situations where referenced information is not \r\n  available at the time the webpack configuration is being loaded.\r\n\r\nWe can circumvent those issues by using a function as the content source for the generated file, like this:\r\n\r\n```javascript\r\nconst fs = require('fs');\r\nconst path = require('path');\r\nconst generate = require('generate-file-webpack-plugin');\r\n\r\nmodule.exports = {\r\n    // ...\r\n    plugins: [\r\n        generate({\r\n            file: 'app-info.js',\r\n            content: () => {\r\n                const appPackage = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json')).toString());\r\n                return `const appInfo = {\r\n                            name: \"${appPackage.name}\",\r\n                            version: \"${appPackage.version}\"\r\n                        }`\r\n            }\r\n        })\r\n    ]\r\n};\r\n```\r\n\r\nNote, that we used an anonymous arrow function in this case. We could have also used a \"regular\" anonymous function, or\r\na named function declared in the webpack configuration.\r\n\r\nWe can further enhance this example by not only using information from the `package.json`, but also from a different\r\ninformation source. It would be useful to add an unique identifier (called `hash` in this case) for the source code from\r\nwhich the application has been build. We use the latest Git commit ID for that in this example. This can be done like \r\nthis:\r\n\r\n```javascript\r\nconst fs = require('fs');\r\nconst path = require('path');\r\nconst { execSync } = require('child_process');\r\nconst generate = require('generate-file-webpack-plugin');\r\n\r\nmodule.exports = {\r\n    // ...\r\n    plugins: [\r\n        generate({\r\n            file: 'app-info.js',\r\n            content: () => {\r\n                const appPackage = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json')).toString());\r\n                const lastCommitId = execSync('git rev-parse HEAD', {timeout: 1000}).toString().trim();\r\n                return `const appInfo = {\r\n                            name: \"${appPackage.name}\",\r\n                            version: \"${appPackage.version}\",\r\n                            hash: \"${lastCommitId}\"\r\n                        }`\r\n            }\r\n        })\r\n    ]\r\n};\r\n```\r\n\r\nJust for readability, we can extract parsing of the `package.json` file and the retrieval of the latest Git commit ID\r\ninto named functions declared in the webpack configuration. \r\n\r\nNote: Calling functions from within a content function is allowed.\r\n\r\n```javascript\r\nmodule.exports = {\r\n    // ...\r\n    plugins: [\r\n        generate({\r\n            file: 'app-info.js',\r\n            content: () => {\r\n                const appPackage = parseAppPackage();\r\n                const lastCommitId = getLastCommitId();\r\n                return `const appInfo = {\r\n                            name: \"${appPackage.name}\",\r\n                            version: \"${appPackage.version}\",\r\n                            hash: \"${lastCommitId}\"\r\n                        }`\r\n            }\r\n        })\r\n    ]\r\n};\r\n\r\nfunction parseAppPackage() {\r\n    return JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json')).toString());\r\n}\r\n\r\nfunction getLastCommitId() {\r\n    return execSync('git rev-parse HEAD', {timeout: 1000}).toString().trim();\r\n}\r\n```\r\n\r\n<a name=\"examples--using-handlebars-templates\"></a>\r\n### Using Handlebars Templates\r\n\r\nPicking up the [Generate Application Info](#examples--generate-app-info) example, we can also use the \r\n[handlebars](https://handlebarsjs.com/) template engine for generating our `app-info.js` file (or any other file you \r\nlike).\r\n\r\nFirst, we have to install the `handlebars` npm package:\r\n\r\n```bash\r\nnpm install handlebars --save-dev\r\n```\r\n\r\nThen, we have to create a handlebars template file, for generating our `app-info.js` file, for this example located in\r\n`src/app-info.hbs`:\r\n\r\n```hbs\r\nconst appInfo = {\r\n    name: \"{{appPackage.name}}\",\r\n    version: \"{{appPackage.version}}\",\r\n    hash: \"{{lastCommitId}}\"\r\n}\r\n```\r\n\r\nFinally, we add the following to our webpack configuration:\r\n\r\n```javascript\r\nconst handlebars = require('handlebars');\r\nconst generate = require('generate-file-webpack-plugin');\r\n\r\nmodule.exports = {\r\n    // ...\r\n    plugins: [\r\n        generate({\r\n            file: 'app-info.js',\r\n            content: () => {\r\n                return template('src/app-info.hbs')({\r\n                    appPackage: parseAppPackage(),\r\n                    lastCommitId: getLastCommitId()\r\n                });\r\n            }\r\n        })\r\n    ]\r\n};\r\n\r\nfunction template(file) {\r\n    return handlebars.compile(fs.readFileSync(path.resolve(__dirname, file)).toString());\r\n}\r\n```\r\n\r\nNote, that for clarity we omitted the definition of the `parseAppPackage()` and `getLastCommitId()` functions. Have a look\r\nat the [Generate Application Info](#examples--generate-app-info) example if you need to know how they are implemented.\r\n\r\nNote, that we defined a (more or less) generic function `template(file)` for compiling our handlebars template file. We\r\nare not relying on the [handlebars-loader](https://github.com/pcardune/handlebars-loader) webpack loader, because the \r\nwebpack configuration setup for making this work would be too complex. Especially, we would have to defined an entry \r\npoint for the loader, and still could not ensure that our plugin gets executed _after_ the loader has done its work.\r\nIn theory we could somehow make it work, but in reality this is just a configuration overkill that you should avoid.\r\n\r\n\r\n<a name=\"examples--generate-multiple-files\"></a>\r\n### Generate Multiple Files\r\n\r\nIn order to generate multiple files, you have to specify multiple invocations of this plugin in the webpack \r\nconfiguration, like this:\r\n\r\n```javascript\r\nmodule.exports = {\r\n    // ...\r\n    plugins: [\r\n        generate({\r\n            file: 'file-1.txt',\r\n            content: 'some content for file 1'\r\n        }),\r\n        generate({\r\n            file: 'file-2.txt',\r\n            content: 'some content for file 2'\r\n        })\r\n    ]\r\n};\r\n```\r\n\r\nOf course you can use all of the features described in previous examples for specifying the content.\r\n\r\n<a name=\"known-problems\"></a>\r\n## Known Problems\r\n\r\nSee [bugs](https://github.com/kflGALORE/generate-file-webpack-plugin/labels/bug)","readmeFilename":"README.md","keywords":["webpack","plugin","webpack-plugin","generate","generator","file","files","create","creator","generic","general-purpose","helper","util"]}