2.1.0 • Published 1 year ago

auto-pic-import v2.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

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}'`
      },
    },
  ],
}
2.1.0

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago