@farmfe/js-plugin-svgr
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

English | 简体中文


Svgr Plugin for Farm

Support compiling Svg as React components in Farm.

Getting Started

To begin, you'll need to @farmfe/js-plugin-svgr:

npm install @farmfe/js-plugin-svgr --save-dev

or

yarn add -D @farmfe/js-plugin-svgr

or

pnpm add -D @farmfe/js-plugin-svgr

Configuring the plugin in farm.config.ts:

import { UserConfig } from '@farmfe/core';
import svgr from '@farmfe/js-plugin-svgr'; //  import the plugin

function defineConfig(config: UserConfig) {
  return config;
}

export default defineFarmConfig({
  compilation: {
    input: {
      index: './index.html'
    },
    output: {
      path: './build'
    }
  },
  plugins: [
    // use the svgr plugin.
    svgr({
      // custom options here
    })
  ]
});

Options

svgrOptions

refer to https://react-svgr.com/docs/options

Readme

Keywords

none

Package Sidebar

Install

npm i @farmfe/js-plugin-svgr

Weekly Downloads

6

Version

1.4.0

License

MIT

Unpacked Size

28.7 MB

Total Files

8

Last publish

Collaborators

  • roland_reed
  • wre232114