{"_id":"rollup-plugin-img","_rev":"13-ab3f2ccca1cf644b743f907089451ef1","name":"rollup-plugin-img","time":{"modified":"2022-06-26T13:59:35.519Z","created":"2017-04-26T10:49:26.316Z","1.0.0":"2017-04-26T10:49:26.316Z","1.0.1":"2017-04-26T11:40:01.863Z","1.0.2":"2017-04-26T11:53:00.935Z","1.0.3":"2017-04-26T12:48:13.415Z","1.0.4":"2017-04-27T02:26:30.138Z","1.0.5":"2017-05-16T08:05:18.385Z","1.0.6":"2017-07-21T05:55:41.137Z","1.1.0":"2017-10-26T11:11:33.764Z"},"maintainers":[{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"}],"dist-tags":{"latest":"1.1.0"},"description":"import image files with rollup","readme":"# rollup-plugin-img\n\nImport image files with rollup. Let you import images just like what you do with webpack in your React code!\n\n\n## Installation\n\n    yarn add --dev rollup-plugin-img\n    \nor \n\n    npm install -D rollup-plugin-img\n    \n## Usage\n\nIn the rollup.config.js:\n\n```JavaScript\nimport image from 'rollup-plugin-img';\n\nexport default {\n  entry: 'src/index.js',\n  dest: 'dist/bundle.js',\n  plugins: [\n    image({\n      limit: 10000\n    })\n  ]\n};\n```\n\nand in your React code:\n\n```JavaScript\nimport img from 'path/image.png';\n\n  ...\n  render() {\n    return <img src={ img } />;\n  }\n  ...\n```\n\n## Options\n\nYou can pass an option to the `image()` just like above, and there are some options:\n\n- exclude & include: Optional. like other rollup plugins. [Details](https://github.com/rollup/rollup/wiki/Plugins)\n- output: Required. the dest path of output image files. The first directory of dest will be handled as the base output directory(where the html file will be, usually).\n- extensions: Optional. a regular expression for the extensions of image files.\n- limit: Optional. the limit(byte) of the file size. A file will be transformed into base64 string when it doesn't exceeded the limit, otherwise, it will be copyed to the dest path.\n- hash: Optional. a boolean value to indicate wheather to generate a hash string in file name(default false).\n\ndemo:\n\n```JavaScript\n  ...\n  image({\n    output: `${distPath}/images`, // default the root\n    extensions: /\\.(png|jpg|jpeg|gif|svg)$/, // support png|jpg|jpeg|gif|svg, and it's alse the default value\n    limit: 8192,  // default 8192(8k)\n    exclude: 'node_modules/**'\n  })\n  ...\n```\n\n## License\n\nMIT\n\n","versions":{"1.0.1":{"name":"rollup-plugin-img","version":"1.0.1","description":"import image files with rollup","main":"dist/index.cjs.js","module":"dist/index.es.js","repository":{"type":"git","url":"git+https://github.com/alwaysonlinetxm/rollup-plugin-img.git"},"bugs":{"url":"https://github.com/alwaysonlinetxm/rollup-plugin-img/issues"},"author":{"name":"alwaysolinetxm"},"license":"MIT","keywords":["rollup","rollup-plugin","image"],"scripts":{"build":"rollup -c","eslint":"eslint src","prepublish":"npm run eslint && npm run build"},"devDependencies":{"eslint":"^3.19.0","rollup":"^0.41.6","rollup-plugin-buble":"^0.15.0"},"dependencies":{"rollup-pluginutils":"^2.0.1"},"gitHead":"ce9a96913a2572702b696dc7d83bb7f5cb86a1a3","homepage":"https://github.com/alwaysonlinetxm/rollup-plugin-img#readme","_id":"rollup-plugin-img@1.0.1","_shasum":"ea2de367443526a8481b8f2f94bba11c0200a3a1","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.0","_npmUser":{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"},"dist":{"shasum":"ea2de367443526a8481b8f2f94bba11c0200a3a1","tarball":"https://registry.npmjs.org/rollup-plugin-img/-/rollup-plugin-img-1.0.1.tgz","integrity":"sha512-CjlFq2BsdDaYiqFnHaxzCQxbKWQtfOOabGwjpSXWWdaHnYHPZ/G4QsqgEvpUrs2h7tWVV6yngq3wUAvB6drGaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDxSvQ6pg3jvXP0+7HnwvH+zh6/GmagdqJo+uSSnN6aNgIhANQ8NtWTExAH7Y+11yaDG2lwWXk3HzL9puVOpFmoMbUT"}]},"maintainers":[{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/rollup-plugin-img-1.0.1.tgz_1493206799532_0.3204408346209675"}},"1.0.2":{"name":"rollup-plugin-img","version":"1.0.2","description":"import image files with rollup","main":"dist/index.cjs.js","module":"dist/index.es.js","repository":{"type":"git","url":"git+https://github.com/alwaysonlinetxm/rollup-plugin-img.git"},"bugs":{"url":"https://github.com/alwaysonlinetxm/rollup-plugin-img/issues"},"author":{"name":"alwaysolinetxm"},"license":"MIT","files":["src","dist","README.md"],"keywords":["rollup","rollup-plugin","image"],"scripts":{"build":"rollup -c","eslint":"eslint src","prepublish":"npm run eslint && npm run build"},"devDependencies":{"eslint":"^3.19.0","rollup":"^0.41.6","rollup-plugin-buble":"^0.15.0"},"dependencies":{"rollup-pluginutils":"^2.0.1"},"gitHead":"00ece01ead8d7f53df55dcb2ed20e14b6ad7b80a","homepage":"https://github.com/alwaysonlinetxm/rollup-plugin-img#readme","_id":"rollup-plugin-img@1.0.2","_shasum":"bacc29f77b7ead021b389e7967a9d05afc1f2b53","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.0","_npmUser":{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"},"dist":{"shasum":"bacc29f77b7ead021b389e7967a9d05afc1f2b53","tarball":"https://registry.npmjs.org/rollup-plugin-img/-/rollup-plugin-img-1.0.2.tgz","integrity":"sha512-CPYOQUitBIz1gMgUPvP40vITEoc+zmUdnRNOYKmzmCKRIPNJoPDgfH3loM2StbyPQh+9wPKBx+uH8hiNJJDcwA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlDNOBUqJ2pau3AMeZxhx9H0egLkzF/ys0u6+Q2GadrwIhAKgYvbijTKK5hK7lFwO1HHKdTkGlNqxzDkshq7IQnt8t"}]},"maintainers":[{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/rollup-plugin-img-1.0.2.tgz_1493207578393_0.5116890179924667"}},"1.0.3":{"name":"rollup-plugin-img","version":"1.0.3","description":"import image files with rollup","main":"dist/index.cjs.js","module":"dist/index.es.js","repository":{"type":"git","url":"git+https://github.com/alwaysonlinetxm/rollup-plugin-img.git"},"bugs":{"url":"https://github.com/alwaysonlinetxm/rollup-plugin-img/issues"},"author":{"name":"alwaysolinetxm"},"license":"MIT","files":["src","dist","README.md"],"keywords":["rollup","rollup-plugin","image"],"scripts":{"build":"rollup -c","eslint":"eslint src","prepublish":"npm run eslint && npm run build"},"devDependencies":{"eslint":"^3.19.0","rollup":"^0.41.6","rollup-plugin-buble":"^0.15.0"},"dependencies":{"rollup-pluginutils":"^2.0.1"},"gitHead":"bf380f4038b72d993832db1aab945bccb78846cb","homepage":"https://github.com/alwaysonlinetxm/rollup-plugin-img#readme","_id":"rollup-plugin-img@1.0.3","_shasum":"0d06195a345d90fb460a17f0dbe3459e895c9c35","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.0","_npmUser":{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"},"dist":{"shasum":"0d06195a345d90fb460a17f0dbe3459e895c9c35","tarball":"https://registry.npmjs.org/rollup-plugin-img/-/rollup-plugin-img-1.0.3.tgz","integrity":"sha512-DXiUU3cTf17bTtEretb9DKA02U1aHwhiVg5sn4+UncpyejffY0GTnDHFaUAaxIAcHS29rIdwFhcc4Fc/bSeP+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDofiaay5VboNTWgSzXhmkcq1E26dd3kcOVNC86qQay9AIhANArAxqS4GFcZisatajmzIdIY1mLKyXxk7SPkoZhDeym"}]},"maintainers":[{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/rollup-plugin-img-1.0.3.tgz_1493210890810_0.12004046398214996"}},"1.0.4":{"name":"rollup-plugin-img","version":"1.0.4","description":"import image files with rollup","main":"dist/index.cjs.js","module":"dist/index.es.js","repository":{"type":"git","url":"git+https://github.com/alwaysonlinetxm/rollup-plugin-img.git"},"bugs":{"url":"https://github.com/alwaysonlinetxm/rollup-plugin-img/issues"},"author":{"name":"alwaysolinetxm"},"license":"MIT","files":["src","dist","README.md"],"keywords":["rollup","rollup-plugin","image"],"scripts":{"build":"rollup -c","eslint":"eslint src","prepublish":"npm run eslint && npm run build"},"devDependencies":{"eslint":"^3.19.0","rollup":"^0.41.6","rollup-plugin-buble":"^0.15.0"},"dependencies":{"rollup-pluginutils":"^2.0.1"},"gitHead":"fc907d21a0d6a968ab198c1c71b74fd895b784cd","homepage":"https://github.com/alwaysonlinetxm/rollup-plugin-img#readme","_id":"rollup-plugin-img@1.0.4","_shasum":"d34218d5bbd463f83231c9ddb7d293efe3bebf9e","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.0","_npmUser":{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"},"dist":{"shasum":"d34218d5bbd463f83231c9ddb7d293efe3bebf9e","tarball":"https://registry.npmjs.org/rollup-plugin-img/-/rollup-plugin-img-1.0.4.tgz","integrity":"sha512-GmkjNVo4M/eFTwXed9dm4QnVOBjAXD80NyTutO4LWXsXz94IQw85HLcjBBTgH8H0Y302+XSQnej/XFpVnCjVJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFlYGpRrNusTl0BkX55tAaDS+zt9FvLflgp+UXQJ+ZfCAiEAlJOh7jzkcaffIwgeka75aZdDuOBMyx4Q9JizMd4apd8="}]},"maintainers":[{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/rollup-plugin-img-1.0.4.tgz_1493259987160_0.5518150955904275"}},"1.0.5":{"name":"rollup-plugin-img","version":"1.0.5","description":"import image files with rollup","main":"dist/index.cjs.js","module":"dist/index.es.js","repository":{"type":"git","url":"git+https://github.com/alwaysonlinetxm/rollup-plugin-img.git"},"bugs":{"url":"https://github.com/alwaysonlinetxm/rollup-plugin-img/issues"},"author":{"name":"alwaysolinetxm"},"license":"MIT","files":["src","dist","README.md"],"keywords":["rollup","rollup-plugin","image"],"scripts":{"build":"rollup -c","eslint":"eslint src","prepublish":"npm run eslint && npm run build"},"devDependencies":{"eslint":"^3.19.0","rollup":"^0.41.6","rollup-plugin-buble":"^0.15.0"},"dependencies":{"rollup-pluginutils":"^2.0.1"},"gitHead":"62c127cd7a255f735b415d27311d79ee43d749ff","homepage":"https://github.com/alwaysonlinetxm/rollup-plugin-img#readme","_id":"rollup-plugin-img@1.0.5","_shasum":"3e0d7651874e15b13a5efac72cc025b277116c99","_from":".","_npmVersion":"4.2.0","_nodeVersion":"6.9.0","_npmUser":{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"},"dist":{"shasum":"3e0d7651874e15b13a5efac72cc025b277116c99","tarball":"https://registry.npmjs.org/rollup-plugin-img/-/rollup-plugin-img-1.0.5.tgz","integrity":"sha512-0EGX6Hr2yLgeQ3ICnkrkgTvK8SzEsMhGF3wofnpjynrSrbwTF8yl26H7vLoGxDR8uRVd2sy+MWtQ+kk3GOMRdg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDS9BMEiE9l3qcmX2cK5iiJbpjFiImBSJSn3MelkdrkvgIgRs1Yul+/hfEtfa/RiQw9jAk9KPgm0QUJ3vd09hAJbIM="}]},"maintainers":[{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/rollup-plugin-img-1.0.5.tgz_1494921918099_0.4508213452063501"}},"1.0.6":{"name":"rollup-plugin-img","version":"1.0.6","description":"import image files with rollup","main":"dist/index.cjs.js","module":"dist/index.es.js","repository":{"type":"git","url":"git+https://github.com/alwaysonlinetxm/rollup-plugin-img.git"},"bugs":{"url":"https://github.com/alwaysonlinetxm/rollup-plugin-img/issues"},"author":{"name":"alwaysolinetxm"},"license":"MIT","files":["src","dist","README.md"],"keywords":["rollup","rollup-plugin","image"],"scripts":{"build":"rollup -c","eslint":"eslint src","prepublish":"npm run eslint && npm run build"},"devDependencies":{"eslint":"^3.19.0","hasha":"^3.0.0","rollup":"^0.41.6","rollup-plugin-buble":"^0.15.0","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-node-resolve":"^3.0.0"},"dependencies":{"rollup-pluginutils":"^2.0.1"},"gitHead":"60f10d688de55127ba44c2fbc4309bd0de777d6c","homepage":"https://github.com/alwaysonlinetxm/rollup-plugin-img#readme","_id":"rollup-plugin-img@1.0.6","_npmVersion":"5.0.3","_nodeVersion":"6.9.0","_npmUser":{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"},"dist":{"integrity":"sha512-Y+MX+v5pc2EBuySBfC7zirBKCrFncUGTW7+G4TBhVTHS2bLdTD+UrMl9+9zCf+n9Y62q1Z1TuCZgnFypupJ0/w==","shasum":"847a94665f5b00cd5c6b92e14ed5454f395aab95","tarball":"https://registry.npmjs.org/rollup-plugin-img/-/rollup-plugin-img-1.0.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiKKAOnVSCeFVA8NFGI6hBf2q4uJD3Z7xk2TfrYnl0SwIgdkfgu+tAcUaiutdKrTxSZStMYw0ACnj4yWH2suRVIko="}]},"maintainers":[{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-img-1.0.6.tgz_1500616541059_0.5542507248464972"}},"1.1.0":{"name":"rollup-plugin-img","version":"1.1.0","description":"import image files with rollup","main":"dist/index.cjs.js","module":"dist/index.es.js","repository":{"type":"git","url":"git+https://github.com/alwaysonlinetxm/rollup-plugin-img.git"},"bugs":{"url":"https://github.com/alwaysonlinetxm/rollup-plugin-img/issues"},"author":{"name":"alwaysolinetxm"},"license":"MIT","files":["src","dist","README.md"],"keywords":["rollup","rollup-plugin","image"],"scripts":{"build":"rollup -c","eslint":"eslint src","prepublish":"npm run eslint && npm run build"},"devDependencies":{"eslint":"^3.19.0","hasha":"^3.0.0","rollup":"^0.41.6","rollup-plugin-buble":"^0.15.0","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-node-resolve":"^3.0.0"},"dependencies":{"rollup-pluginutils":"^2.0.1"},"gitHead":"f681d7239786b96e2aebd739512b55151c8486c4","homepage":"https://github.com/alwaysonlinetxm/rollup-plugin-img#readme","_id":"rollup-plugin-img@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.0","_npmUser":{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"},"dist":{"integrity":"sha512-44JyY0wBQFNjM2pB7Yv1uUwMW4S1bjdnzLmUPShrDeACSMvn798i9ttwiBkfls+QjSY0qLrNqMacUTDX93Q0MA==","shasum":"17ec10045f6c234a7a59ff1e2d46af4524dd3ffb","tarball":"https://registry.npmjs.org/rollup-plugin-img/-/rollup-plugin-img-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8C8ngaA9Fyxn9o4C1sIJvgHziiLrB7Qv18GymqtK2LQIhAKTLhtUE74HjiVyvHeISNPFirpeYQfxbXO0VbLQbdgPC"}]},"maintainers":[{"name":"alwaysonlinetxm","email":"alwaysonlinetxm@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-img-1.1.0.tgz_1509016293676_0.30746913864277303"}}},"homepage":"https://github.com/alwaysonlinetxm/rollup-plugin-img#readme","keywords":["rollup","rollup-plugin","image"],"repository":{"type":"git","url":"git+https://github.com/alwaysonlinetxm/rollup-plugin-img.git"},"author":{"name":"alwaysolinetxm"},"bugs":{"url":"https://github.com/alwaysonlinetxm/rollup-plugin-img/issues"},"license":"MIT","readmeFilename":"README.md"}