
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
babel-plugin-cloudinary
Advanced tools
Compile cloudinary URLs at build time.
You can define the globals for your cloudinary URLs in a cloudinaryrc.json that should be placed in the root of your project.
{
"native": {
"cloud_name": "trivago",
"secure": true
},
"overrideBaseUrl": true,
"host": "trivago.images.com",
"defaultTransforms": {
"fetch_format": "auto",
"quality": "auto"
}
}
cloudinary-core upon instantiation, you can use
all the configs in the official cloudinary API.res.cloudinary.com/trivago/image/upload).option.transforms of that __buildCloudinaryUrl call.__buildCloudinaryUrl(assetName, options);
http[s]://host/<transforms>/<prefix><assetName><postfix><resourceExtension>
options
are entirely optional.{height: 250, width: 250}).
For convince they will keep the same API as the cloudinary-core image transformations, these said you can check the official docs and use the cloudinary-core API directly.assetName.assetName.assetName, let's suppose that your assetName is dog-picture you can
simple pass dog-picture.jpeg within the assetName itself. This optional parameter is only here you to give you a more robust API and also the possibility to interpolate the prefix and postfix with the assetName as you can see in the url above URL structure <prefix><assetName><postfix><resourceExtension>.npm install babel-plugin-cloudinary
{
"plugins": ["babel-plugin-cloudinary"]
}
// gallery.js
function getImageUrl(imageName) {
// compiles into "`${'https://res.cloudinary.com/<cloud_name>/image/upload/'}${imageName}${'.jpeg'}`;"
return __buildCloudinaryUrl(imageName, {
transforms: {
width: 250,
height: 250,
},
resourceExtension: ".jpeg",
});
}
This projects ships together with the plugin a types definition file (index.d.ts) that will
be automatically recognized by IDEs and text editors with typescript based IntelliSense. In case you have some linting in place it might also be convenient to make __buildCloudinaryUrl a global. With eslint you can achieve this by adding a simple property to the globals block just like:
// .eslintrc.js
module.exports = {
// ...
globals: {
// ...
__buildCloudinaryUrl: true,
},
// ...
};
FAQs
Compile cloudinary URLs at build time
The npm package babel-plugin-cloudinary receives a total of 11 weekly downloads. As such, babel-plugin-cloudinary popularity was classified as not popular.
We found that babel-plugin-cloudinary demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.