![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
rollup-plugin-generate-image-sizes
Advanced tools
Automatically generate image sizes for use in srcsets.
Useful for when you want to automatically resize images for use in a srcset / other responsive web design implementations.
npm i -D rollup-plugin-generate-image-sizes
// rollup.config.js
import { generateImageSizes } from 'rollup-plugin-generate-image-sizes';
export default {
plugins: [
generateImageSizes({
dir: 'static',
size: [1400, 1024, 640, 320],
hook: 'renderStart',
quality: 65,
inputFormat: ['jpg', 'jpeg', 'png'],
outputFormat: ['jpg'],
forceUpscale: false,
skipExisting: true,
maxParallel: 4,
outputManifest: 'static/images-manifest.json'
})
]
}
Note: All output files are named in the pattern <original-filename>@<size>w.<file-extension>
. The plugin looks for the @
symbol to determine which files have already been converted, which means that all files with the @
will be ignored. Files with #
are also ignored.
dir
(required | string
or [string]
) the string or array of strings specifying the directory where the images we want to resize are.
size
(default: [1400, 1024, 640, 320] | int
or [int]
) An integer or array of integers specifying the width in pixels of our output image.
hook
(default: renderStart) the rollup hook that this plugin should use.
quality
(default: 65 | int
): The quality of output images, for image formats that have output quality controls.
inputFormat
(default: ['jpg', 'jpeg', 'png'] | string
or [string]
): The file extensions of the images we care about. Must be a format supported by jimp, or match
, which matches the input format of the image.
outputFormat
(default: 'jpg' | string
or [string]
): The file extensions of the images we want to output. Must be a format supported by jimp or match
, which is used to match the input format.
forceUpscale
(default: false | boolean
): If the source image is larger, do we want to forcibly generate a scaled up version or whether we should just ignore it.
skipExisting
(default: true | boolean
): whether we should skip existing images that have already been resized. a false value means that images will be regenerated and overwritten every single time this script is run.
maxParallel
(default: 4 | int
): the max number of parallel images that can be processed concurrently.
outputManifest
(default: null | string
): the file to output a json containing all the images this plugin generated.
MIT
FAQs
Automatically generate image sizes for use in srcsets.
The npm package rollup-plugin-generate-image-sizes receives a total of 31 weekly downloads. As such, rollup-plugin-generate-image-sizes popularity was classified as not popular.
We found that rollup-plugin-generate-image-sizes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.