onebay / vite-plugin-imp

A vite plugin for import library component style automatic.
MIT License
231 stars 24 forks source link

Support to transform imports into different formats (esm and cjs) #97

Open emosheeep opened 10 months ago

emosheeep commented 10 months ago

Describe the feature

If I use it in a library and want to output two formats (esm and cjs), I can transform an import into only one format.

import { Button } from '@arco-design/mobile-react';
import Button from '@arco-design/mobile-react/esm/Button'; // in esm format
import Button from '@arco-design/mobile-react/cjs/Button'; // in cjs format

Can this plugin support this case?