
Research
/Security News
Fake imToken Chrome Extension Steals Seed Phrases via Phishing Redirects
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.
svelte-image-preprocessor-cloudinary
Advanced tools
Image preprocessor for Svelte to use cloudinary remote images
This package is a pre-processor for Svelte/SvelteKit applications that automates the image optimization using Cloudinary.
It parses your img tags, upload the source image to your cloudinary account and replace the content of the html tag with an optimized cloudinary url and srcset.
This package is heavily inspired by svelte-image.
yarn add svelte-image-preprocessor-cloudinary -D
or
npm install svelte-image-preprocessor-cloudinary -D
svelte-image-preprocessor-cloudinary needs to be added as dev dependency as Svelte requires original component source.
In your svelte.config.js file add svelte-image-preprocessor-cloudinary to the pre-process section of it:
....
import preprocess from 'svelte-preprocess';
import { imagePreprocessor } from 'svelte-image-preprocessor-cloudinary';
...
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [preprocess(),imagePreprocessor()],
....
};
...
You'll need to setup a couple of environment variables to make this work.
Create an .env file and add the following
CLOUDINARY_CLOUD_NAME= YOUR_CLOUD_NAME
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET
The image processor accepts a few options
const defaults = {
// Minimum width for responsive images
min_width: 375,
// Max width for responsive images
max_width: 1024,
// Number of images to create for responsive images
max_images: 10,
}
You can change any of this values by passing an object as options to the pre-processor
....
import preprocess from 'svelte-preprocess';
import { imagePreprocessor } from 'svelte-image-preprocessor-cloudinary';
...
const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [preprocess(),imagePreprocessor({
min_width: 200
})],
....
};
...
This package works flawesly for images directly referenced as string literal in your templates like:
<img src="/some_local_image.png" /> or <img src="http://remoteimage.png" /> but is not yet possible to handle dynamic sources.
The pre-processor have now way to know the value of a dynamic variable passed as a source in build time, therefore this <img src={someVariable} /> will not be managed by the pre-processor.
Enjoy!
FAQs
Image preprocessor for Svelte to use cloudinary remote images
We found that svelte-image-preprocessor-cloudinary 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.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.