Socket
Socket
Sign inDemoInstall

recma-import-images

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

recma-import-images

recma plugin to import image sources


Version published
Maintainers
1
Install size
119 kB
Created

Readme

Source

recma-import-images

recma plugin to import image sources

Installation

npm install recma-import-images
import { compile } from '@mdx-js/mdx'
import { recmaImportImages } from 'recma-import-images'

let mdx = `![](./image.jpg)`

await compile(mdx, {
  recmaPlugins: [recmaImportImages],
})

Example

  /*@jsxRuntime automatic @jsxImportSource react*/
+ import image_jpg$recmaImportImages from "./image.jpg";
  import {jsx as _jsx} from "react/jsx-runtime";
  function _createMdxContent(props) {
    const _components = Object.assign({
      p: "p",
      img: "img"
    }, props.components);
    return _jsx(_components.p, {
      children: _jsx(_components.img, {
-       src: "./image.jpg",
+       src: image_jpg$recmaImportImages,
        alt: ""
      })
    });
  }
  function MDXContent(props = {}) {
    const {wrapper: MDXLayout} = props.components || ({});
    return MDXLayout ? _jsx(MDXLayout, Object.assign({}, props, {
      children: _jsx(_createMdxContent, props)
    })) : _createMdxContent(props);
  }

Keywords

FAQs

Last updated on 26 Apr 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc