auto-pic-import
v2.1.0
Published
A tool which can import and export pic automatically
Downloads
3
Readme
auto-pic-import
A tool which can import and export pic automatically
Notes:
pls name each pic correctly according to the Naming rules for variables
Quick-start
npm i auto-pic-import
Config file autoImport.config.ts
import { defineAutoImportConfig } from 'auto-pic-import'
export default {
configs: [
{
targetDir: './src/assets/images',
depth: true,
autoPrefix: true,
},
{
targetDir: './src/assets/svgs',
customImport: (fileName, fileUrl) => {
return `import { ReactComponent as ${fileName} } from '${fileUrl}'`
},
},
],
}