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

Ship unplugin-auto-import with vue & vue-router presets #243

Open
TechAkayy opened this issue Mar 30, 2023 · 1 comment
Open

Ship unplugin-auto-import with vue & vue-router presets #243

TechAkayy opened this issue Mar 30, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@TechAkayy
Copy link

Similar to having unplugin-vue-components, it might be worth including unplugin-auto-import within Iles by default so that APIs can be auto-imported on demand.

unplugin-auto-import is a wrapper on top of https://github.com/unjs/unimport which is used by Nuxt's auto-import as well, and is well-maintained.

Sensible presets for this plugin are: vue & vue-router (another nice alternative would be https://github.com/posva/unplugin-vue-router which is next-gen)

This could be a nice supplement if we decide to turn off reactivityTransform by default.

@ElMassimo ElMassimo added the enhancement New feature or request label Mar 30, 2023
@TechAkayy
Copy link
Author

TechAkayy commented Apr 3, 2023

Also would be good to have this exposed as a config (for eg, autoImportAPIs), so that presets can be extended by users as required. These presets can be those shipped within unplugin-auto-import & those shipped part of libraries.

Something similar to vite's mergeConfig could be used to merge default & overrides.

For eg,

import { defineConfig } from 'iles'
import { VueRouterAutoImports } from 'unplugin-vue-router'

export default defineConfig({
  siteUrl: 'https://iles-docs.netlify.app',
  jsx: 'preact',

  autoImportAPIs: {
      imports: [
        '@vueuse/core',
        VueRouterAutoImports
      ],
  },
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants