{"_id":"@bsmth/img-loader","_rev":"9-4c454fec07fea3a6bfaa3596b3d5bcd0","name":"@bsmth/img-loader","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@bsmth/img-loader","version":"1.0.0","description":"Magical image loading.","main":"dist/cjs/index.js","module":"dist/esm/index.js","repository":"","author":{"name":"johh","email":"johannes@resn.co.nz"},"license":"BSD-4-Clause","private":false,"sideEffects":false,"keywords":[],"scripts":{"build":"rollup -c","declaration":"tsc --emitDeclarationOnly","type-check":"tsc --noEmit","dev":"rollup -c -w","lint":"eslint --ext .ts,.tsx,.js src/"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.10.5","@babel/eslint-parser":"^7.13.8","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4","@babel/preset-env":"^7.10.4","@babel/preset-typescript":"^7.10.4","@types/imagemin-gifsicle":"^7.0.0","@types/imagemin-svgo":"^9.0.0","@types/loader-utils":"^2.0.1","@types/object-hash":"^1.3.4","@types/sharp":"^0.27.1","@types/svgo":"^2.3.0","@typescript-eslint/eslint-plugin":"^4.7.0","@typescript-eslint/parser":"^4.7.0","eslint":"^7.21.0","eslint-config-airbnb-typescript":"^12.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-react":"^7.20.0","eslint-plugin-react-hooks":"^4.2.0","husky":"^4.2.5","lint-staged":"^10.2.11","rollup":"^2.22.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.27.1","ts-transformer-properties-rename":"^0.9.0","tslib":"^2.0.0","typescript":"^4.0.5","webpack":"^5.24.3"},"dependencies":{"@types/imagemin-mozjpeg":"^8.0.0","chalk":"^4.1.0","imagemin":"^7.0.1","imagemin-gifsicle":"^7.0.0","imagemin-mozjpeg":"^9.0.0","imagemin-pngquant":"^9.0.1","imagemin-svgo":"^9.0.0","loader-utils":"^2.0.0","object-hash":"^2.1.1","ora":"^5.3.0","sharp":"^0.27.2","svgo":"2"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx,js}":"eslint --max-warnings 1"},"gitHead":"8d309d1ea59c73c5072ca6015751c59e5cbaaf8d","_id":"@bsmth/img-loader@1.0.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-+Xb4zzp3v8ZFav1vTTqxucHoFARMAouGz0TEPqfakpMlGihkXLYt8HBkne4FTAPFRNCE60eraFfH7sLC0GEGaw==","shasum":"86f6794b249db96616d5f1f950e599304639d96b","tarball":"https://registry.npmjs.org/@bsmth/img-loader/-/img-loader-1.0.0.tgz","fileCount":44,"unpackedSize":5205422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnCszCRA9TVsSAnZWagAA2JsQAKRTQJYL1u/BQslAFjiJ\nkoWNWXm/jdIS0tkRJMY7s88bmwH1lNW+4zqf4RYvYEDqzetEGWt+nIl6/UUf\n8/hXZcwKpg+tIPJy3uC73x1LTvE8TEiQuTEM5N7tCgXN6Cl0M4EFgYnYy0U1\nicL/mPylSieNG4AXzeWA5SaHD3030u8w9XdmMsFo2UWvguKLotAxvx+UsHpL\nqbElbZBjB31Mu/NU3VVtm4FRJw+Hjz4hOarWij4AcW4VfyVKcb+MUKkX6lRg\nbjK6D9ut+7yfWgGNmy55uppLoyJRhDe2ET7IfPa2YHRDouCoqwRRylGXa7W9\nQ4kM39A46bYjSgmnlTyqhHU9b+1+IWzcdMu+BJC/z8BJ/NLkISiOBO5thtJT\n6ZnA6kE18Q3TIAlW6bPO/OAiNjQXsf/YkAwzf95stZCfu4IGHkpUhP8JF0p1\nyjFxSdDVj/2LRUWOFg9dnxPisnRsJKZl4CAfNVpzu9J5Ya/bhBX5W6raqhdU\n2Uy8cjOxj8nqiN5+1sWmmLJIQUY0Nf28nojoMtTx5dhgYtQ02tx1DkIENMB7\nbPC9/4AXHzBtyZK+3SUVBB5G+e5alKUKr4OmXCcZQ2rrGlKEnZVftzKgyYQI\n32RoZ15tRvEQxE63/q029iPSsqDL0slNEyjBOUuyNhGeZeu6DrEzkt583KRB\n2f/s\r\n=I9s2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwCPwpdB+LFNk2FzLZvPXYUhE9oiH5/1CrTzCbfWxsewIgZHfv0IflxbJKaUUxqNiR9edvPGLe1xQf+PQcBsrcL+A="}]},"_npmUser":{"name":"johh","email":"npm@johh.net"},"directories":{},"maintainers":[{"name":"johh","email":"npm@johh.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/img-loader_1.0.0_1620847410689_0.7509552392309051"},"_hasShrinkwrap":false},"1.0.1":{"name":"@bsmth/img-loader","version":"1.0.1","description":"Magical image loading for webpack.","main":"dist/cjs/index.js","module":"dist/esm/index.js","repository":{"type":"git","url":"git+https://github.com/project-bismuth/img-loader.git"},"author":{"name":"johh","email":"code@johh.net"},"license":"MIT","private":false,"sideEffects":false,"keywords":[],"scripts":{"build":"rollup -c","declaration":"tsc --emitDeclarationOnly","type-check":"tsc --noEmit","dev":"rollup -c -w","lint":"eslint --ext .ts,.tsx,.js src/"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.10.5","@babel/eslint-parser":"^7.13.8","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4","@babel/preset-env":"^7.10.4","@babel/preset-typescript":"^7.10.4","@types/imagemin-gifsicle":"^7.0.0","@types/imagemin-mozjpeg":"^8.0.0","@types/imagemin-svgo":"^9.0.0","@types/loader-utils":"^2.0.1","@types/object-hash":"^1.3.4","@types/sharp":"^0.27.1","@types/svgo":"^2.3.0","@typescript-eslint/eslint-plugin":"^4.7.0","@typescript-eslint/parser":"^4.7.0","eslint":"^7.21.0","eslint-config-airbnb-typescript":"^12.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-react":"^7.20.0","eslint-plugin-react-hooks":"^4.2.0","husky":"^4.2.5","lint-staged":"^10.2.11","rollup":"^2.22.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.27.1","ts-transformer-properties-rename":"^0.9.0","tslib":"^2.0.0","typescript":"^4.0.5","webpack":"^5.24.3"},"dependencies":{"chalk":"^4.1.0","imagemin":"^7.0.1","imagemin-gifsicle":"^7.0.0","imagemin-mozjpeg":"^9.0.0","imagemin-pngquant":"^9.0.1","imagemin-svgo":"^9.0.0","loader-utils":"^2.0.0","object-hash":"^2.1.1","ora":"^5.3.0","sharp":"^0.27.2","svgo":"2"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx,js}":"eslint --max-warnings 1"},"gitHead":"d0fc5ed9ed46295e269be90283264f347d2dbf0d","bugs":{"url":"https://github.com/project-bismuth/img-loader/issues"},"homepage":"https://github.com/project-bismuth/img-loader#readme","_id":"@bsmth/img-loader@1.0.1","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-d+193pZB7YwuGeMaaDUI/mVVS/GMsLfX4il/QMDnRA49QZ/x6w9fufoE0eGEP8NxzXK7rfDkG5oy5jGXvn3ZEg==","shasum":"ae04db31f71f1eaae1c8599c8212dec83f2f1432","tarball":"https://registry.npmjs.org/@bsmth/img-loader/-/img-loader-1.0.1.tgz","fileCount":44,"unpackedSize":5205467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnnFBCRA9TVsSAnZWagAACRIP/Rs9FAuTfX6R4AkJkoN3\nwoJPupP2wHNP29Kq4STKthLw+txnh0Nvnif1f/5wqssdQzrGLZSfN70zbpAG\nGHvU9B0t1dblkLilKWKHsd4z6VVSfgBuVh1mivi7lz8KXHNAZr8CkiY1MUSv\nOCjPLKre7i0BSV18Kr8wEa6WQCZI55tX7IvbEed+B7Rc9G3OfhTxeSmvu8jK\niViAOjTFaRU5nKgHgPwZfuN7a1OxhAtbtrFbv70vKYAn7V+N6XWuRxsPj/FF\n9C2GsSiLsfn5NUYVB93dTtp/vtm7JJhCSRj4xe7l83ZzsBZg8ivUpsUZ+f9u\nCepmQZ4qU/C2eGz0o1b9q74roDPHL1A413FOAl48+7fGj0uSm6VKWS0nSQLz\nxIzfRJFl72aiXMQ88C2J/dGRO8SrzykJO3cGEYLOipN3D/mVVx78PTbTw5S9\nCaYLrHxbBpA0bKsQjK+OEVboVyN6aX+g7/on3yP8caKiqZVlXkUl+ZUNHE+z\nfE23q7Ixhhii/kHwJrRd4HGuOWIpft3Du2TtXmArH5SEAU+YhAcPgIMa/6jA\nVuA0OkwSr6Ge5uUUWqSObNKfBEO+IdR4JxVhCTVnBJE3M70is4+EuNhX1FcJ\ni2W29GU1QaO8iNBhT/FGPUdWGUO1Jwc4hB/JqIqAEdHl/1VXlc3FGjlOC4Ms\npoet\r\n=IG8o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBC71y5xh0y4CmgdBmXNybYAnkUfjLGXftHYxyMkGPTAiAD6KK495o0okJ6o7exAJ4k5DOZPtMnKzxA/AwusWIaYQ=="}]},"_npmUser":{"name":"johh","email":"npm@johh.net"},"directories":{},"maintainers":[{"name":"johh","email":"npm@johh.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/img-loader_1.0.1_1620996417159_0.49126772252676787"},"_hasShrinkwrap":false},"1.0.2":{"name":"@bsmth/img-loader","version":"1.0.2","description":"Magical image loading for webpack.","main":"dist/cjs/index.js","module":"dist/esm/index.js","repository":{"type":"git","url":"git+https://github.com/project-bismuth/img-loader.git"},"author":{"name":"johh","email":"code@johh.net"},"license":"MIT","private":false,"sideEffects":false,"keywords":[],"scripts":{"build":"rollup -c","declaration":"tsc --emitDeclarationOnly","type-check":"tsc --noEmit","dev":"rollup -c -w","lint":"eslint --ext .ts,.tsx,.js src/"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.10.5","@babel/eslint-parser":"^7.13.8","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.10.4","@babel/preset-env":"^7.10.4","@babel/preset-typescript":"^7.10.4","@types/imagemin-gifsicle":"^7.0.0","@types/imagemin-mozjpeg":"^8.0.0","@types/imagemin-svgo":"^9.0.0","@types/loader-utils":"^2.0.1","@types/object-hash":"^1.3.4","@types/sharp":"^0.27.1","@types/svgo":"^2.3.0","@typescript-eslint/eslint-plugin":"^4.7.0","@typescript-eslint/parser":"^4.7.0","eslint":"^7.21.0","eslint-config-airbnb-typescript":"^12.0.0","eslint-plugin-import":"^2.22.1","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-react":"^7.20.0","eslint-plugin-react-hooks":"^4.2.0","husky":"^4.2.5","lint-staged":"^10.2.11","rollup":"^2.22.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.27.1","ts-transformer-properties-rename":"^0.9.0","tslib":"^2.0.0","typescript":"^4.0.5","webpack":"^5.24.3"},"dependencies":{"chalk":"^4.1.0","imagemin":"^7.0.1","imagemin-gifsicle":"^7.0.0","imagemin-mozjpeg":"^9.0.0","imagemin-pngquant":"^9.0.1","imagemin-svgo":"^9.0.0","loader-utils":"^2.0.0","object-hash":"^2.1.1","ora":"^5.3.0","sharp":"^0.27.2","svgo":"2"},"peerDependencies":{},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx,js}":"eslint --max-warnings 1"},"gitHead":"5c94341d240df5f0998f538983700d65549b7b91","bugs":{"url":"https://github.com/project-bismuth/img-loader/issues"},"homepage":"https://github.com/project-bismuth/img-loader#readme","_id":"@bsmth/img-loader@1.0.2","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-KxS4qzV3yZILnUN4brs5kllaaM2Yxm55QY6X/W5uykx5RSBn+4rZqAVgvmGu4cAx4juUFA9ugIlju7pQRY7bbQ==","shasum":"5c436dbf7f01e0c4cf7804888252c7c682755af2","tarball":"https://registry.npmjs.org/@bsmth/img-loader/-/img-loader-1.0.2.tgz","fileCount":44,"unpackedSize":5205643,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgnuKyCRA9TVsSAnZWagAA3qQP/25soTvYND0vVR7eJQtk\njNv0/JssOYCaAIZJgRsyG/m9lqoNztgKorhAiPr/r7VALgwwEse7px5yiWPT\nbTx0XpJRbB3ViiDqX4eGv5XZmpm+cnwtDnMQume+aWu0Hn+edMWtNBCVaXwE\nOlLG34EM5w6sRHT9MlUxQaM+BPGWqhlAne+4fI6h1xVB0m4EOJ5Nm/C5p3HL\n9KGMSPvfk49MeAm5xNBsF7mUTRBFaGMyeL4ce8BCzEgcbDGFMRGpOHpkf0gk\n0p9VSaV7FXrsHAt9dqNA0j9uP0CRMrdtvzpEPY0/sYCj7vMSBUztwQYmxzSR\nuy3E48g4KY3Tt9QWvdWTkfVSzGzbxGcimqWDKUDAWhuTZP5ook9yBp80o2Lb\ng/emmtGOSKQtmRGdjQII5n7bdqXmCnxZgzOpRNhmvrxUE9EJEYpJwcm2T70j\ncW0dap68ymEbUPTFScJaPb38FfR2f+khl8OYYQ6LboiYKUbf6DpuXCDPJtql\ne5mGce4WWaDEqMR72wrSvK2DCIhaQFM/8hY2HGGOyWSG5UU+wml1Y1yPOB+p\nYGZoXrGYkBLP53KsDaDZWTn8uDWtJIh3CymGOK/OpHzokRROwLMXiNrQzXEu\nswPxJHVLQXRT/nQjq8i1oVr9DohDG4I6cKrvCGwlZrN6Sx/ybDnFwsRNgf0v\nu9A6\r\n=3uJn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA6X7hwZOzJF3QW6rSyi5xVAOOO95Qcs1BTC160fgK8dAiBxof8aRxiO6QW8ggULfTtq6fG64Irl1+B/XuQQ4cCkOQ=="}]},"_npmUser":{"name":"project-bismuth","email":"bismuth@johh.net"},"directories":{},"maintainers":[{"name":"project-bismuth","email":"bismuth@johh.net"},{"name":"johh","email":"npm@johh.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/img-loader_1.0.2_1621025457382_0.9259645503761957"},"_hasShrinkwrap":false},"1.1.0":{"name":"@bsmth/img-loader","version":"1.1.0","description":"Magical image loading for webpack.","main":"dist/cjs/index.js","module":"dist/esm/index.js","repository":{"type":"git","url":"git+https://github.com/project-bismuth/img-loader.git"},"author":{"name":"johh","email":"code@johh.net"},"license":"MIT","private":false,"sideEffects":false,"keywords":[],"scripts":{"build":"rollup -c","declaration":"tsc --emitDeclarationOnly","type-check":"tsc --noEmit","dev":"rollup -c -w","lint":"eslint --ext .ts,.tsx,.js src/","prepare":"husky install"},"devDependencies":{"@babel/cli":"^7.14.3","@babel/core":"^7.14.3","@babel/eslint-parser":"^7.14.4","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.14.4","@babel/preset-env":"^7.14.4","@babel/preset-typescript":"^7.10.4","@bsmth/loader-cache":"^1.0.1","@types/imagemin-gifsicle":"^7.0.0","@types/imagemin-mozjpeg":"^8.0.0","@types/imagemin-svgo":"^9.0.0","@types/loader-utils":"^2.0.2","@types/object-hash":"^2.1.0","@types/sharp":"^0.28.3","@types/svgo":"^2.3.0","@typescript-eslint/eslint-plugin":"^4.26.0","@typescript-eslint/parser":"^4.26.0","eslint":"^7.27.0","eslint-config-airbnb-typescript":"^12.0.0","eslint-plugin-import":"^2.23.4","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-react":"^7.24.0","eslint-plugin-react-hooks":"^4.2.0","husky":"^6.0.0","lint-staged":"^11.0.0","rollup":"^2.50.5","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.30.0","ts-transformer-properties-rename":"^0.11.0","tslib":"^2.2.0","typescript":"^4.3.2","webpack":"^5.38.1"},"dependencies":{"@bsmth/loader-progress":"^1.0.0","chalk":"^4.1.1","imagemin":"7","imagemin-gifsicle":"^7.0.0","imagemin-mozjpeg":"^9.0.0","imagemin-pngquant":"^9.0.2","imagemin-svgo":"^9.0.0","loader-utils":"^2.0.0","object-hash":"^2.2.0","ora":"^5.4.0","sharp":"^0.28.3","svgo":"2"},"peerDependencies":{"@bsmth/loader-cache":"^1.0.1"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx,js}":"eslint --max-warnings 1"},"gitHead":"37c62d311a98b163afb83e8effeafc06686b7aec","bugs":{"url":"https://github.com/project-bismuth/img-loader/issues"},"homepage":"https://github.com/project-bismuth/img-loader#readme","_id":"@bsmth/img-loader@1.1.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-ueN4ZinQwm1wiB9eAuAJt2wxZfhTkIh64CnJlgHssNAsFfHx+4MV2BX7UoIQU/3k6RpIuMYYLM4pNJAmIhK0ag==","shasum":"0827280d21d5eac6bc594bb0aca506f1bdf28d2a","tarball":"https://registry.npmjs.org/@bsmth/img-loader/-/img-loader-1.1.0.tgz","fileCount":38,"unpackedSize":5197266,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguOVSCRA9TVsSAnZWagAAn8wP/jTemmj6gm5iMz5BrG2A\n9gjQmw0rPbfAF68oIuiHpM5nNmv90zGk8ossbMAW9JhqkSprxlLQ5otQ+C8f\nDRixd9I3MN0Orwq4vY4e2loYCNNQJWkPd8PNWexR//1Np5FNiEg1QzwRUO0C\nfvDIgNCcAd3vN62/uxDoxOLECO8z68jqLxm9oooHEHFPtvE34Pd4KoXQsZ/J\n8BkpTH/o1Qbv2NsmtAKCO+j+Lmt3xSZU1pO/2qRnzQkc4NL+CJpNhpwmp+mI\nir4PJsFnOtpaMW82kx9rId5b7327xETyeyb89iw9Rb2jrTI2NIL7hYAmZiAg\nzz33yrqBjtfIGxXT6yhZ7YgNnJBblIGCTdviBJNWW9TeBxwzA94fwTwHzlju\n+/h8XrSFyN0dweyA3FDnn+QPE5zg36fDABvicEh+EG6XtWP/pJUC3VmezqpO\nctm2ykdGR52zg9vEqtJqRuweYopK1fW9XxfPcHoJTvvWH5Fgdq10bBAl6r99\n0atf3swaK73ImCzMk3lm5Yse4HMC7FUjQztDBAebtxx0jhU4EkLtUydHlFBG\nMJYehFttyE6MINoUMMdUV52hgVk1fj74TVFyCTRd56uFSckErizfUD9qKrWQ\nYG1xsr2gs/n14FvCk1BRSwmfNWRF/+w8JOrtEa/T3zOX2cZxfWMmEv1wa/cf\nhKfL\r\n=ZcEw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAD5iVslVad+XDGkkiNxhJS01qF5MINxk9vvySj2xg7lAiEA6o2dhss9Z5wGRkxnXwepLl2CYMTZOwTTdWjJs5Ljezs="}]},"_npmUser":{"name":"project-bismuth","email":"bismuth@johh.net"},"directories":{},"maintainers":[{"name":"project-bismuth","email":"bismuth@johh.net"},{"name":"johh","email":"npm@johh.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/img-loader_1.1.0_1622730065891_0.3859549006020946"},"_hasShrinkwrap":false},"1.1.1":{"name":"@bsmth/img-loader","version":"1.1.1","description":"Magical image loading for webpack.","main":"dist/cjs/index.js","module":"dist/esm/index.js","repository":{"type":"git","url":"git+https://github.com/project-bismuth/img-loader.git"},"author":{"name":"johh","email":"code@johh.net"},"license":"MIT","private":false,"sideEffects":false,"keywords":[],"scripts":{"build":"rollup -c","declaration":"tsc --emitDeclarationOnly","type-check":"tsc --noEmit","dev":"rollup -c -w","lint":"eslint --ext .ts,.tsx,.js src/","prepare":"husky install"},"devDependencies":{"@babel/cli":"^7.14.3","@babel/core":"^7.14.3","@babel/eslint-parser":"^7.14.4","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.14.4","@babel/preset-env":"^7.14.4","@babel/preset-typescript":"^7.10.4","@types/imagemin-gifsicle":"^7.0.0","@types/imagemin-mozjpeg":"^8.0.0","@types/imagemin-svgo":"^9.0.0","@types/loader-utils":"^2.0.2","@types/object-hash":"^2.1.0","@types/sharp":"^0.28.3","@types/svgo":"^2.3.0","@typescript-eslint/eslint-plugin":"^4.26.0","@typescript-eslint/parser":"^4.26.0","eslint":"^7.27.0","eslint-config-airbnb-typescript":"^12.0.0","eslint-plugin-import":"^2.23.4","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-react":"^7.24.0","eslint-plugin-react-hooks":"^4.2.0","husky":"^6.0.0","lint-staged":"^11.0.0","rollup":"^2.50.5","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.30.0","ts-transformer-properties-rename":"^0.11.0","tslib":"^2.2.0","typescript":"^4.3.2","webpack":"^5.38.1"},"dependencies":{"@bsmth/loader-cache":"^1.0.1","@bsmth/loader-progress":"^1.0.0","chalk":"^4.1.1","imagemin":"7","imagemin-gifsicle":"^7.0.0","imagemin-mozjpeg":"^9.0.0","imagemin-pngquant":"^9.0.2","imagemin-svgo":"^9.0.0","loader-utils":"^2.0.0","object-hash":"^2.2.0","ora":"^5.4.0","sharp":"^0.28.3","svgo":"2"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx,js}":"eslint --max-warnings 1"},"gitHead":"c403a1cb1424d991a1cfe2bc27ad2de2f52cf2d1","bugs":{"url":"https://github.com/project-bismuth/img-loader/issues"},"homepage":"https://github.com/project-bismuth/img-loader#readme","_id":"@bsmth/img-loader@1.1.1","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-lvTUj/oPkt7fXPQSwvg+03saSQpGDrY5ycImOJxWFraRUxwjvKMuWcZ26iwQP73soUiOgsfh/sm/xVFWDwZWWg==","shasum":"79e63b0afd83dafe957366e71d0cdf0211894711","tarball":"https://registry.npmjs.org/@bsmth/img-loader/-/img-loader-1.1.1.tgz","fileCount":38,"unpackedSize":5197205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguRGDCRA9TVsSAnZWagAAUw0QAIyeO4rPWqo9ibrLdMvq\nLGPY0Sxt+uOsYwFWt2DajhEcb6sq9279sCkuirh5BMA9gQO98iRlaCtqF2HY\nLEcHsNQfHVDwG3mV963U9UHAInVX5NSe4ukUv1KYOnX2zl+7JGDtagQnMEDX\nWR6xmaJ2dujx6tXTojFEG5hKR/NQJhcmVnSEJI9yEtT1NlML1anPeGemkuSh\ntnntZQMge56NfvCblxZ0k1Uwjic0GqrcU/0A+ZS3u4jqfbjQh9vQCGwVUmz1\n7HiNZtK5QOUjxG/0//NHkfNAoNVGPqcu328FwwKVuVbaR2gAefcF+2e0wvMk\nE2wNSs2G3DFdlZgUrv3qIgmag4E5DfzcK2s0lwIxhqKEUyGIoGUF45nyaeZw\nIuaFGb8oSb8O46ga7OWnlk7DZl8VfsXhCBT48/com6nvDXKzlxA7x8kHriub\nJ56e3E7tKLqWalOsPSOdLWQ2UcDxVRwaHtNzF9z3KmMGn3c3qSwVZU8Q2d97\nEGl2qQSQeW4yre6c1Y7iEnLEaXwE+LDKiIXTau8pXR+HaeNDXpWoXxHv6+ex\n2NbUEfK1VWk2/6cChAbPm8tGjn19MeY4ULrOafAYTUasN0mOHKEeNHvrUbbk\n+Fe6ejTll3kn1PXyDVL0T1G9Lk9Jtcb58/tpOrzw3ku7crJ9sifPu4S3W0io\nKsQL\r\n=U8MI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAC7bn7gIyByzfdNb5KhSInARF8LBwhspp1qFTY0n8WFAiEAw205AKz7hcisud8UqnMHj9Q1O1AyV4Lonj1Zhp9S4fE="}]},"_npmUser":{"name":"project-bismuth","email":"bismuth@johh.net"},"directories":{},"maintainers":[{"name":"project-bismuth","email":"bismuth@johh.net"},{"name":"johh","email":"npm@johh.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/img-loader_1.1.1_1622741379435_0.03581310052874276"},"_hasShrinkwrap":false},"1.1.2":{"name":"@bsmth/img-loader","version":"1.1.2","description":"Magical image loading for webpack.","main":"dist/cjs/index.js","module":"dist/esm/index.js","repository":{"type":"git","url":"git+https://github.com/project-bismuth/img-loader.git"},"author":{"name":"johh","email":"code@johh.net"},"license":"MIT","private":false,"sideEffects":false,"keywords":[],"scripts":{"build":"rollup -c","declaration":"tsc --emitDeclarationOnly","type-check":"tsc --noEmit","dev":"rollup -c -w","lint":"eslint --ext .ts,.tsx,.js src/","prepare":"husky install"},"devDependencies":{"@babel/cli":"^7.14.3","@babel/core":"^7.14.3","@babel/eslint-parser":"^7.14.4","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.14.4","@babel/preset-env":"^7.14.4","@babel/preset-typescript":"^7.10.4","@types/imagemin-gifsicle":"^7.0.0","@types/imagemin-mozjpeg":"^8.0.0","@types/imagemin-svgo":"^9.0.0","@types/loader-utils":"^2.0.2","@types/sharp":"^0.28.3","@types/svgo":"^2.3.0","@typescript-eslint/eslint-plugin":"^4.26.0","@typescript-eslint/parser":"^4.26.0","eslint":"^7.27.0","eslint-config-airbnb-typescript":"^12.0.0","eslint-plugin-import":"^2.23.4","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-react":"^7.24.0","eslint-plugin-react-hooks":"^4.2.0","husky":"^6.0.0","lint-staged":"^11.0.0","rollup":"^2.50.5","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.30.0","ts-transformer-properties-rename":"^0.11.0","tslib":"^2.2.0","typescript":"^4.3.2","webpack":"^5.38.1"},"dependencies":{"@bsmth/loader-cache":"^1.0.1","@bsmth/loader-progress":"^1.0.0","@types/object-hash":"^2.1.0","chalk":"^4.1.1","imagemin":"7","imagemin-gifsicle":"^7.0.0","imagemin-mozjpeg":"^9.0.0","imagemin-pngquant":"^9.0.2","imagemin-svgo":"^9.0.0","loader-utils":"^2.0.0","object-hash":"^2.2.0","sharp":"^0.28.3","svgo":"2 <2.4"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx,js}":"eslint --max-warnings 1"},"gitHead":"1a0347ca670917554fd5c56aa55d156783036e0b","bugs":{"url":"https://github.com/project-bismuth/img-loader/issues"},"homepage":"https://github.com/project-bismuth/img-loader#readme","_id":"@bsmth/img-loader@1.1.2","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-iQXzQ6t3ZXxCECR2ln0XDDhaMdg2nESMTVBT1Q1TQ7GDI+pDORg19mkItR80ECbm6JZAVSYQCr5B0mMWD/+5UQ==","shasum":"4d84ecab23e9a602b586bb536b93783d2a464740","tarball":"https://registry.npmjs.org/@bsmth/img-loader/-/img-loader-1.1.2.tgz","fileCount":38,"unpackedSize":5197293,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICs9lWchAJPshHABrfdXsp5hrCUdTPeKdUD/QPtWPgWlAiBwQzI/PJgc4Uw9aHtKBktY0cWMUpKyNlPJ0MN6GdrjrQ=="}]},"_npmUser":{"name":"project-bismuth","email":"bismuth@johh.net"},"directories":{},"maintainers":[{"name":"johh","email":"npm@johh.net"},{"name":"project-bismuth","email":"bismuth@johh.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/img-loader_1.1.2_1632782617134_0.15161619977011243"},"_hasShrinkwrap":false},"1.2.0":{"name":"@bsmth/img-loader","version":"1.2.0","description":"Magical image loading for webpack.","main":"dist/cjs/index.js","module":"dist/esm/index.js","repository":{"type":"git","url":"git+https://github.com/project-bismuth/img-loader.git"},"author":{"name":"johh","email":"code@johh.net"},"license":"MIT","private":false,"sideEffects":false,"keywords":[],"scripts":{"build":"rollup -c","declaration":"tsc --emitDeclarationOnly","type-check":"tsc --noEmit","dev":"rollup -c -w","lint":"eslint --ext .ts,.tsx,.js src/","prepare":"husky install"},"devDependencies":{"@babel/cli":"^7.14.3","@babel/core":"^7.14.3","@babel/eslint-parser":"^7.14.4","@babel/plugin-proposal-class-properties":"^7.10.4","@babel/plugin-proposal-object-rest-spread":"^7.14.4","@babel/preset-env":"^7.14.4","@babel/preset-typescript":"^7.10.4","@types/imagemin-gifsicle":"^7.0.0","@types/imagemin-mozjpeg":"^8.0.0","@types/imagemin-svgo":"^9.0.0","@types/loader-utils":"^2.0.2","@types/sharp":"^0.29.2","@types/svgo":"^2.3.0","@typescript-eslint/eslint-plugin":"^4.26.0","@typescript-eslint/parser":"^4.26.0","eslint":"^7.27.0","eslint-config-airbnb-typescript":"^12.0.0","eslint-plugin-import":"^2.23.4","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-react":"^7.24.0","eslint-plugin-react-hooks":"^4.2.0","husky":"^6.0.0","lint-staged":"^11.0.0","rollup":"^2.50.5","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.30.0","ts-transformer-properties-rename":"^0.11.0","tslib":"^2.2.0","typescript":"^4.3.2","webpack":"^5.38.1"},"dependencies":{"@bsmth/loader-cache":"^1.0.1","@bsmth/loader-progress":"^1.0.0","@types/object-hash":"^2.1.0","chalk":"^4.1.1","imagemin":"7","imagemin-gifsicle":"^7.0.0","imagemin-mozjpeg":"^9.0.0","imagemin-pngquant":"^9.0.2","imagemin-svgo":"^9.0.0","loader-utils":"^2.0.0","object-hash":"^2.2.0","sharp":"^0.29.1","svgo":"2 <2.4"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,tsx,js}":"eslint --max-warnings 1"},"gitHead":"dadcc5957bc0bb2c72fb6119aa22cfc0a3f19548","bugs":{"url":"https://github.com/project-bismuth/img-loader/issues"},"homepage":"https://github.com/project-bismuth/img-loader#readme","_id":"@bsmth/img-loader@1.2.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-SgjPETpxe74yZBYvSaBa8qCElarjYk1WRNP/+WEIROYUdt2C8T8OoOtJYQZdF5R4XXj/akPhrH102MlB/WYlaw==","shasum":"8c0cd307ae0e947b6d12e1a40755acee63339d57","tarball":"https://registry.npmjs.org/@bsmth/img-loader/-/img-loader-1.2.0.tgz","fileCount":38,"unpackedSize":5208869,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzaJzCRA9TVsSAnZWagAAyRkP/2vHi0SEqAeZWqDJnbS6\nz1t6gYdyKS3z26bPL1bHqcp/Zonyouzqrwu6RF8A6cnk5sGsMIqSRRduLcxN\nJY7XTBfJ2sOtCDwOsFXUAtaZRQZXRt2s4KrY/o5dXA3aUl32uOX2gBBGpNqK\n71Ps3Qi4udSvqinvAJTTZjvMh7o0yIsjGMkGghfhev1YRIJEoPRamAFfhcxi\nw00JFnonW3AroFaSZ+0JRRYKxs9UIQlQIs2UTHt/1il9ChV11zEKy2vzHpfs\n4Y/vCJrLbYj/HgUdjkU2gY8FzPX+HOqeZjiBHrfw8qFr+NWZT8YQE7fiqp0f\n34rJqzEaiSW56hKqjOuaY8prKBA/zwnQiZwl7rpADKowDMbKgMjcC9J5VMQu\nJNAlm48NE/z+v+ucQHEzHQxpByHrkzxFF8a2JjOoOwEXAwwei49wDktde3Df\nwG0NAOwVRX13MYNPQZqACfZO4mJJf3bl1YmCLZrpmid/UtyFk+rz/wR3pYQh\n/vOLDl8jflzu6QYCf4W6i9TRXS8cde1sn4YPfiREN3VbiwIMDOCPHsiF78VD\nzCS6hxgGS5FNDt98azNw6luyr0iVu52v7Sv6TQJ59sYOP2qaJ/8fmjaw8fO7\nxc6Wd07Z0YFj4NCNM1TXFg3ov+qghzlKzCFZ3jofX9SoOYrn6svNXP0+W2Gg\n39vr\r\n=/BHS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXsxXw5x/zsEFA57/J0V+czeDKjXQI+OXE+GqwqtYX/AiBaZhS4ehLse2jyUSHOMJkHuQut2NNZ5sCedY9wmDi+tQ=="}]},"_npmUser":{"name":"project-bismuth","email":"bismuth@johh.net"},"directories":{},"maintainers":[{"name":"johh","email":"npm@johh.net"},{"name":"project-bismuth","email":"bismuth@johh.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/img-loader_1.2.0_1634917891495_0.676795497644811"},"_hasShrinkwrap":false}},"time":{"created":"2021-05-12T19:23:30.327Z","1.0.0":"2021-05-12T19:23:30.868Z","modified":"2022-04-04T20:50:57.758Z","1.0.1":"2021-05-14T12:46:57.469Z","1.0.2":"2021-05-14T20:50:57.678Z","1.1.0":"2021-06-03T14:21:06.103Z","1.1.1":"2021-06-03T17:29:39.651Z","1.1.2":"2021-09-27T22:43:37.454Z","1.2.0":"2021-10-22T15:51:31.703Z"},"maintainers":[{"name":"johh","email":"npm@johh.net"},{"name":"project-bismuth","email":"bismuth@johh.net"}],"description":"Magical image loading for webpack.","keywords":[],"author":{"name":"johh","email":"code@johh.net"},"license":"MIT","readme":"# 🌄🧙🏼‍♀️ bismuth image loader\n\n> Magical image loading for webpack! ✨\n\n## Motivations\n\nDealing with images can be really messy, when you have to support multiple resolutions, formats and compression levels. `@bsmth/img-loader` attempts to solve this by doing all conversions, resizing and compressions automatically and on demand, when you import an image.\n\nhttps://user-images.githubusercontent.com/5791070/120940715-e92e3d00-c71e-11eb-9ab9-a94815fce5fc.mp4\n\n---\n\n## Installation\n\n```\nyarn add --dev @bsmth/img-loader @bsmth/loader-cache\n```\n\n```\nnpm i --save-dev @bsmth/img-loader @bsmth/loader-cache\n```\n\n---\n\n## Setup\n\nYou'll need to add the loader and its [cache management plugin](#caching) to your webpack config.\n\n```typescript\nimport { CachePlugin } from \"@bsmth/loader-cache\";\n\nexport default {\n\tmodule: {\n\t\trules: [\n\t\t\t// ...\n\t\t\t{\n\t\t\t\ttest: /\\.(jpe?g|png|gif|svg)$/i,\n\t\t\t\tuse: [\n\t\t\t\t\t{\n\t\t\t\t\t\tloader: \"@bsmth/img-loader\",\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\t// ...\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tplugins: [\n\t\t// ...\n\t\tnew CachePlugin({\n\t\t\t// ...\n\t\t}),\n\t],\n};\n```\n\n---\n\n## Usage\n\nInside your project you can now import images like so:\n\n```typescript\nimport myImg from \"./img.png\";\n```\n\nBy default, `myImg` will give you the following object:\n\n```typescript\n{\n\tsrc: 'path/to/compressed/img.png',\n\twebp: 'path/to/webp/img.webp',\n\tprefix: 'your/webpack/public/path/',\n\twidth: 500,\n\theight: 500,\n\taspect: 1,\t// aspect ratio of source image\n\talpha: true,\t// whether the image contains transparent areas\n\tthumbnail: {\n\t\twidth: 4,\n\t\theight: 4,\n\t\tdata: 'base64 encoded raw RGBA data',\n\t},\n\tsizes: {},\n}\n\n```\n\nYou can specify `quality` and `mode` by adding a query string:\n\n```typescript\nimport myImg from \"./img.png?mode=texture&quality=high\";\n```\n\nIn this case you will get the same as above plus a `.basis` version:\n\n```typescript\n{\n\t// ...\n\tbasis: 'path/to/basis/img.basis',\n}\n\n```\n\n---\n\n## Config\n\n### General options\n\n| Name                   | Type      | Default                          | Description                                                                                                                                      |\n| ---------------------- | --------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `name`                 | `string`  | `'[name].[contenthash:6].[ext]'` | Specifies the output filename template.<br> Note, that `@bsmth/img-loader` may append an option hash for different renditions of the same input. |\n| `outputPath`           | `string`  | `''`                             | Specifies where the output files will be placed.                                                                                                 |\n| `optionHashLength`     | `number`  | `4`                              | the length of the options-hash that may be appended to the output filename.                                                                      |\n| `generateDeclarations` | `boolean` | `false`                          | whether to emit typescript declarations for all image imports. See [Typescript](#typescript)                                                     |\n\n### Image options\n\n| Name                  | Type                                                             | Default                                                                                               | Description                                                                                                                                                                                             |\n| --------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `skipCompression`     | `boolean`                                                        | `false`                                                                                               | disables image compression/optimisation for PNG, JPEG, SVG and GIF outputs                                                                                                                              |\n| `forcePowerOfTwo`     | `boolean`                                                        | `false`                                                                                               | whether to force a power of 2 resolution.                                                                                                                                                               |\n| `powerOfTwoStrategy`  | `'upscale' \\| 'downscale' \\| 'nearest' \\| 'area'`                | `'area'`                                                                                              | how the power of 2 resolution is calculated. `upscale`, `downscale` and `nearest` should be self-descriptive. `area` rounds to the nearest power of 2 while attempting to match the source images area. |\n| `emitAvif`            | `boolean`                                                        | `false`                                                                                               |                                                                                                                                                                                                         |\n| `emitWebp`            | `boolean`                                                        | `true`                                                                                                | whether a WebP version should also be created.                                                                                                                                                          |\n| `emitBasis`           | `boolean`                                                        | `false`                                                                                               | whether a basis version should also be created.                                                                                                                                                         |\n| `thumbnail`           | `false \\| object`                                                | [see below](#thumbnail)                                                                               | either a config object ([see below](#thumbnail)) or `false` to disable.                                                                                                                                 |\n| `qualityLevels`       | `Record<string, QualityLevel>`                                   | [see default config](https://github.com/project-bismuth/img-loader/blob/master/src/defaultOptions.ts) | an object of quality levels. See below.                                                                                                                                                                 |\n| `defaultQualityLevel` | `string`                                                         | `'medium'`                                                                                            | the quality level used if none is explicitly set                                                                                                                                                        |\n| `modes`               | `Record<string, Mode>`                                           | [see default config](https://github.com/project-bismuth/img-loader/blob/master/src/defaultOptions.ts) | an object of modes. [See below.](#Modes)                                                                                                                                                                |\n| `sizes`               | `Record<string, Size>`                                           | [see default config](https://github.com/project-bismuth/img-loader/blob/master/src/defaultOptions.ts) | an object of sizes. [See below](#Sizes).                                                                                                                                                                |\n| `resizeKernel`        | `'nearest' \\| 'cubic' \\| 'mitchell' \\| 'lanczos2' \\| 'lanczos3'` | `'lanczos3'`                                                                                          | the interpolation kernel used for downscaling                                                                                                                                                           |\n\n---\n\n### Quality levels\n\nQuality levels give you granular control over how your images are compressed.\n\nA quality level may be set by adding a `?quality=` query parameter to the import statement. If none is set, the `defaultQualityLevel` is chosen.\n\nIf you override the default config, you must specify at least one quality level.\n\nEach quality level object accepts the following properties:\n\n| Name       | Type     | Description                                                                                                      |\n| ---------- | -------- | ---------------------------------------------------------------------------------------------------------------- |\n| `avif`     | `object` | AVIF compression options. See [sharp AVIF output options](https://sharp.pixelplumbing.com/api-output#avif).      |\n| `webp`     | `object` | WebP compression options. See [sharp WebP output options](https://sharp.pixelplumbing.com/api-output#webp).      |\n| `pngquant` | `object` | PNG compression options. See [imagemin-pngquant options](https://github.com/imagemin/imagemin-pngquant#options). |\n| `mozjpeg`  | `object` | JPEG compression options. See [imagemin-mozjpeg options](https://github.com/imagemin/imagemin-mozjpeg#options).  |\n| `gifsicle` | `object` | GIF compression options. See [imagemin-gifsicle options](https://github.com/imagemin/imagemin-gifsicle#options). |\n| `svgo`     | `object` | SVG compression options. See [imagemin-svgo options](https://github.com/imagemin/imagemin-svgo#options).         |\n| `basis`    | `object` | Basis compression options. See [basis options below](#basis).                                                    |\n\n---\n\n### Modes\n\nModes let you selectively override **all** image options (including sizes) and quality levels. (the specified overrides will be merged into their respective targets)\n\nThey may be triggered by adding a `?mode=` query parameter to the import statement, or by a test function.\n\n#### Example\n\nEnable basis output and force power of 2 sizes for all images imported with `?mode=example` or with `'example'` in their path:\n\n```typescript\n// webpack loader options\n{\n\t// ...\n\tmodes: {\n\t\texample: {\n\t\t\ttest: ( relativePath, absolutePath ) => relativePath.includes( 'example' ),\n\t\t\temitBasis: true,\n\t\t\tforcePowerOfTwo: true,\n\t\t},\n\t},\n}\n\n```\n\n---\n\n### Sizes\n\nSizes let you generate multiple named resolutions of the same source image.\n\nConfiguring a size adds a corresponding set of additional exports to the `sizes` object of the image.\n\nEach size object accepts the any combination of the following properties:\n\n| Name    | Type         | Default                                 | Description                                                                                                             |\n| ------- | ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |\n| `scale` | `number` < 1 | `1`                                     | Dimension scalar. The dimensions of the original image are multiplied by this.                                          |\n| `max`   |              | `{ width: Infinity, height: Infinity }` | Dimension cap in pixels. All images will be downscaled to **at least** fit this resolution                              |\n| `min`   |              | `{ width: 1, height: 1 }`               | Minimum pixel dimensions an image may have after downscaling. Images originally smaller than this will not be upscaled. |\n\nNote that `forcePowerOfTwo` takes precedence over this, so depending on your `powerOfTwoStrategy` setting, you may get files that are larger or smaller than expected.\n\nScaling of GIFs and SVGs is not supported currently. The exports are still created, but they point to the full size image.\n\nYou can override the default behaviour (root `src`/`webp`/`basis` exports) by specifying a `default` size.\n\n#### Example\n\nCap the size of all images at `4000px`×`3000px` and export an additional \"mobile\" size at half res, not downscaling below `300px`×`300px` but at least to `2000px`×`2000px`:\n\n```typescript\n// webpack loader options\n{\n\t// ...\n\tsizes: {\n\t\tdefault: {\n\t\t\tmax: {\n\t\t\t\twidth: 4000,\n\t\t\t\theight: 3000,\n\t\t\t}\n\t\t},\n\t\tmobile: {\n\t\t\tscale: .5,\n\t\t\tmin: {\n\t\t\t\twidth: 300,\n\t\t\t\theight: 300,\n\t\t\t},\n\t\t\tmax: {\n\t\t\t\twidth: 2000,\n\t\t\t\theight: 2000,\n\t\t\t},\n\t\t},\n\t},\n}\n\n```\n\nGiven a `5000px`×`5000px` input image, output resolutions are the following:\n\n-   `default`: `3000px`×`3000px`\n-   `mobile`: `2000px`×`2000px`\n\nWhile a `500px`×`500px` input image yields:\n\n-   `default`: `500px`×`500px`\n-   `mobile`: `300px`×`300px`\n\nImporting that image then gives you:\n\n```typescript\n{\n\tsrc: 'path/to/compressed/img.png',\n\twebp: 'path/to/webp/img.webp',\n\tprefix: 'your/webpack/public/path/',\n\twidth: 500,\n\theight: 500,\n\taspect: 1,\n\talpha: true,\n\tthumbnail: {\n\t\twidth: 4,\n\t\theight: 4,\n\t\tdata: 'base64 encoded raw RGBA data',\n\t},\n\tsizes: {\n\t\tmobile: {\n\t\t\twidth: 300,\n\t\t\theight: 300,\n\t\t\tsrc: 'path/to/mobile/img.png',\n\t\t\twebp: 'path/to/mobile/img.webp',\n\t\t},\n\t},\n}\n\n```\n\n---\n\n### Thumbnail\n\n`@bsmth/img-loader` can generate a tiny thumbnail that is available synchronously.\n\n| Name     | Type             | Default | Description                                                                                                                                                                                           |\n| -------- | ---------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `width`  | `number`         | `4`     | thumbnail width in pixels                                                                                                                                                                             |\n| `height` | `number`         | `4`     | thumbnail height in pixels                                                                                                                                                                            |\n| `format` | `'raw' \\| 'png'` | `'raw'` | specifies the thumbnail data encoding format.<br>`'raw'` gives you the raw RGBA data as a base64 encoded string, while `'png'` outputs a data URL that you can use directly, e.g. as an `<img>` `src` |\n\n---\n\n### Default config\n\nThe default config can be found [here](https://github.com/project-bismuth/img-loader/blob/master/src/defaultOptions.ts).\n\n---\n\n## Typescript\n\n`@bsmth/img-loader` can auto-generate declarations for your image imports, based on your config!\n\nBy setting `generateDeclarations` to `true` in your config, `@bsmth/img-loader` will emit a file named `img-imports.d.ts` into your project root, containing declarations for every possible file extension, quality and mode combination.\n\nNaturally, this file can become quite large, depending on your config. To somewhat mitigate this, we assume that `mode` always comes before `quality` in any given query string. E.g. `*.png?mode=texture&quality=medium` is valid, `*.png?quality=medium&mode=texture` isn't.\n\nNote that only the `mode` set via a query parameter can be detected by Typescript. You may see inaccurate types for files where `mode` is set via a `test` function.\n\nTo include the declarations in your TS setup, add this to your `tsconfig.json`:\n\n```JSON\n{\n\t\"include\": [\n\t\t\"./img-imports.d.ts\"\n\t]\n}\n```\n\nThis will also give you access to the `BismuthImage` type for your convenience.\n\n---\n\n## Caching\n\n`@bsmth/img-loader` will cache all processed images and intermediates on disk. This is handled by the `CachePlugin` exported by `@bsmth/loader-cache`, which [accepts some options](https://github.com/project-bismuth/loader-cache#options).\n\n---\n\n## Pitfalls/Shortcomings\n\n### Speed\n\nImage conversion / compression can be slow, especially when working with `.basis` files on higher quality settings. Since webpack has to wait for the compression to complete, hot reloading will be blocked during that time.\n\nIf things get too slow, you can temporarily limit the amount of processing that needs to be done, by setting `skipCompression` and `emitWebp`/`emitBasis` conditionally. If you choose to do so, remember to also keep unused cache files by setting `deleteUnusedFiles`, otherwise already generated renditions may be deleted. Also, the renditions need to be generated at some point – You may inadvertently force that workload on your CI, if you forget to generate them locally.\n\nI'm looking into ways to decouple the compression tasks from webpack, but this is still a ways away.\n\n### Working with git / CI\n\nWithout an up to date cache, `@bsmth/img-loader` will create all necessary renditions on startup. This can lead to insanely long build- and startup times. To circumvent this, it may be desirable to push the entire cache directory (`.bsmth-loader-cache` by default) to git LFS. While this is not ideal, all renditions will only be created once and reused on subsequent runs.\n\n### Size\n\nDon't forget to configure your CDN / server to deliver your `UASTC` `.basis` files with `gzip` or `brotli` compression! Their disk size is 4 bytes per pixel, so a 1024x1024 texture is 4MB uncompressed. This may also baloon your git LFS size, so be aware of that when using `UASTC` textures.\n\n---\n\n## Basis\n\n`@bsmth/img-loader` ships with binaries of the [Basis Universal Supercompressed GPU Texture Codec](https://github.com/BinomialLLC/basis_universal) reference encoder.\n\nBasis is a very complex topic in and of itself. `@bsmth/img-loader` exports a `BasisOptions` type to help you find an option combination that is valid.\nPlease refer to the [basis repo](https://github.com/BinomialLLC/basis_universal#readme) for info on the options.\n\nA `basis` options object can have the following props:\n\n| Name                                  | Type                 |  Codec  | basisu equivalent / description                                                                                                                                                          |\n| ------------------------------------- | -------------------- | :-----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `forceAlpha`                          | `boolean`            |         | `-force_alpha`                                                                                                                                                                           |\n| `mipmaps`                             | `boolean`            |         | `-mipmaps`                                                                                                                                                                               |\n| `mipFilter`                           | `string`             |         | `-mip_filter filter`, defaults to `'lanczos3'`.<br>See [`BasisOptions.ts`](https://github.com/project-bismuth/img-loader/blob/master/src/types/BasisOptions.ts) for all possible values. |\n| `linear`                              | `boolean`            |         | `-linear`, also sets `-mip_linear`                                                                                                                                                       |\n| `yFlip`                               | `boolean`            |         | `-y_flip`                                                                                                                                                                                |\n| `normalMap`                           | `boolean`            |         | `-normal_map`                                                                                                                                                                            |\n| `separateRgToColorAlpha`              | `boolean`            |         | `-separate_rg_to_color_alpha`                                                                                                                                                            |\n| `codec`                               | `'ETC1S' \\| 'UASTC'` |         | switches between both codec options.<br>Only options relevant for the active codec will be sent to basis.                                                                                |\n| `compLevel`                           | `number`             | `ETC1S` | `-comp_level number`                                                                                                                                                                     |\n| `noEndpointRdo`                       | `boolean`            | `ETC1S` | `-no_endpoint_rdo`                                                                                                                                                                       |\n| `noSelectorRdo`                       | `boolean`            | `ETC1S` | `-no_selector_rdo`                                                                                                                                                                       |\n| `disableHierarchicalEndpointCodebook` | `boolean`            | `ETC1S` | `-disable_hierarchical_endpoint_codebook`                                                                                                                                                |\n| `quality`                             | `number`             | `ETC1S` | `-q number`, ignored if `maxEndpoints` or `maxSelectors` is set.                                                                                                                         |\n| `maxEndpoints`                        | `number`             | `ETC1S` | `-max_endpoints number`                                                                                                                                                                  |\n| `maxSelectors`                        | `number`             | `ETC1S` | `-max_selectors number`                                                                                                                                                                  |\n| `uastcLevel`                          | `number`             | `UASTC` | `-uastc_level number`                                                                                                                                                                    |\n| `uastcRdoQ`                           | `number`             | `UASTC` | `-uastc_rdo_q number`                                                                                                                                                                    |\n\n---\n\n## To-dos\n\n-   [x] better cache cleaning\n-   [x] support for generating multiple sizes\n-   [ ] webpack config validation\n-   [ ] better documentation\n-   [ ] async generation (not blocking webpack while images are being compressed)\n-   [ ] examples\n-   [ ] tests\n\n---\n\n## License\n\n© 2021 the project bismuth authors, licensed under MIT.\n\nThis project uses the[ Basis Universal format and reference encoder](https://github.com/BinomialLLC/basis_universal) which is © 2021 Binomial LLC, licensed under Apache 2.0.\n","readmeFilename":"README.md","homepage":"https://github.com/project-bismuth/img-loader#readme","repository":{"type":"git","url":"git+https://github.com/project-bismuth/img-loader.git"},"bugs":{"url":"https://github.com/project-bismuth/img-loader/issues"}}