@farmfe/js-plugin-svgr
v1.9.0
Published
support svgr compile for farm.
Downloads
5,882
Readme
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