Describe the bug
cloned the repo.
installed element plus.
used all the unplugin packages:
// import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
// import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import ElementPlus from 'unplugin-element-plus/vite'
did not work.
added some scss link pre processor:
// css: {
// preprocessorOptions: {
// scss: {
// additionalData: '@use "~/styles/element/index.scss" as *;',
// },
// },
// },
did not work.
what is wrong with the setup ? does it not work with auto imports ?
@antfu @YunYouJun
// vite config
///
import path from 'path'
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import Pages from 'vite-plugin-pages'
// import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite'
// import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import ElementPlus from 'unplugin-element-plus/vite'
export default defineConfig({
resolve: {
alias: {
'~/': ${path.resolve(__dirname, 'src')}/
,
},
},
// css: {
// preprocessorOptions: {
// scss: {
// additionalData: '@use "~/styles/element/index.scss" as *;',
// },
// },
// },
plugins: [
Vue({
reactivityTransform: true,
}),
ElementPlus({
// options
}),
// https://github.com/hannoeru/vite-plugin-pages
Pages(),
// https://github.com/antfu/unplugin-auto-import
AutoImport({
imports: [
'vue',
'vue/macros',
'vue-router',
'@vueuse/core',
],
dts: true,
dirs: [
'./src/composables',
],
vueTemplate: true,
}),
// https://github.com/antfu/vite-plugin-components
// Components({
// dts: true,
// // extensions: ['vue', 'md'],
// // include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
// // resolvers: [
// // ElementPlusResolver({
// // importStyle: 'sass',
// // }),
// // ],
// }),
],
// https://github.com/vitest-dev/vitest
test: {
environment: 'jsdom',
},
})
Reproduction
just adding element plus to vitesse lite repo
System Info
System:
OS: Windows 10 10.0.19044
CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
Memory: 17.08 GB / 31.76 GB
Binaries:
Node: 16.13.1 - C:\Dev\nodejs\node.EXE
Yarn: 1.22.18 - C:\Dev\nodejs\yarn.CMD
npm: 8.1.2 - C:\Dev\nodejs\npm.CMD
Used Package Manager
npm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.