Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discuss: an idea to make this plugin easier #19

Closed
psaren opened this issue Dec 11, 2021 · 0 comments
Closed

Discuss: an idea to make this plugin easier #19

psaren opened this issue Dec 11, 2021 · 0 comments
Labels
discuss Discuss this repo enhancement New feature or request

Comments

@psaren
Copy link
Contributor

psaren commented Dec 11, 2021

I have an idea to make this plugin easier , like below:

import { defineConfig } from 'vite'
import vitePluginImp from 'vite-plugin-imp'
export default defineConfig({
  plugins: [vitePluginImp()]
})

Implementation:
we collect a default libList from frequently used libraries.

defaultLibList: [
  {
    libName: 'lodash',
    libDirectory: '',
    camel2DashComponentName: false,
    style: () => {
      return false;
    },
  },
  {
    libName: 'antd',
    style: (name) => `antd/es/${name}/style`
  },
  // other frequently used libraries.
  ...
]
  1. defaultLibList will be filter by dependencies of package.json(for better prefomance).
  2. Combined libList and defaultLibList into one list(combinedLibList), if libList has a lib duplicate with defaultLibList, use the one in libList.
  3. Add a option exclude: string[] options to exclude the lib in combinedLibList.

Last but not least, ensure that the changes are compatible with the previous version.

Please feel free to comment, and I look for to having deeper discussion with you.

@psaren psaren added enhancement New feature or request discuss Discuss this repo labels Dec 11, 2021
@psaren psaren pinned this issue Dec 12, 2021
@psaren psaren mentioned this issue Dec 27, 2021
@psaren psaren closed this as completed Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Discuss this repo enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant