|
@@ -12,58 +12,67 @@ import VueMacros from 'unplugin-vue-macros/vite'
|
|
|
import Icons from 'unplugin-icons/vite'
|
|
|
import IconsResolver from 'unplugin-icons/resolver'
|
|
|
|
|
|
-export default defineConfig({
|
|
|
- // base:'/webapps/page/liankao/',
|
|
|
- resolve: {
|
|
|
- alias: {
|
|
|
- '~/': `${path.resolve(__dirname, 'src')}/`,
|
|
|
- '@': `${path.resolve(__dirname, 'src')}`,
|
|
|
+export default defineConfig(({command}) => {
|
|
|
+ const cfg = {
|
|
|
+ base:'',
|
|
|
+ resolve: {
|
|
|
+ alias: {
|
|
|
+ '~/': `${path.resolve(__dirname, 'src')}/`,
|
|
|
+ '@': `${path.resolve(__dirname, 'src')}`,
|
|
|
|
|
|
- },
|
|
|
- },
|
|
|
- plugins: [
|
|
|
- VueMacros({
|
|
|
- plugins: {
|
|
|
- vue: Vue({
|
|
|
- reactivityTransform: true,
|
|
|
- }),
|
|
|
},
|
|
|
- }),
|
|
|
- WindiCss(),
|
|
|
- // https://github.com/hannoeru/vite-plugin-pages
|
|
|
- Pages({ extensions: ['vue'] }),
|
|
|
+ },
|
|
|
+ plugins: [
|
|
|
+ VueMacros({
|
|
|
+ plugins: {
|
|
|
+ vue: Vue({
|
|
|
+ reactivityTransform: true,
|
|
|
+ }),
|
|
|
+ },
|
|
|
+ }),
|
|
|
+ WindiCss(),
|
|
|
+ // https://github.com/hannoeru/vite-plugin-pages
|
|
|
+ Pages({ extensions: ['vue'] }),
|
|
|
|
|
|
- // https://github.com/antfu/unplugin-auto-import
|
|
|
- AutoImport({
|
|
|
- imports: [
|
|
|
- 'vue',
|
|
|
- 'vue/macros',
|
|
|
- 'vue-router',
|
|
|
- '@vueuse/core',
|
|
|
- ],
|
|
|
- dts: true,
|
|
|
- dirs: [
|
|
|
- './src/composables',
|
|
|
- ],
|
|
|
- vueTemplate: true,
|
|
|
- resolvers: [ElementPlusResolver()],
|
|
|
- }),
|
|
|
+ // https://github.com/antfu/unplugin-auto-import
|
|
|
+ AutoImport({
|
|
|
+ imports: [
|
|
|
+ 'vue',
|
|
|
+ 'vue/macros',
|
|
|
+ 'vue-router',
|
|
|
+ '@vueuse/core',
|
|
|
+ ],
|
|
|
+ dts: true,
|
|
|
+ dirs: [
|
|
|
+ './src/composables',
|
|
|
+ ],
|
|
|
+ vueTemplate: true,
|
|
|
+ resolvers: [ElementPlusResolver()],
|
|
|
+ }),
|
|
|
|
|
|
- // https://github.com/antfu/vite-plugin-components
|
|
|
- Components({
|
|
|
- dts: true,
|
|
|
- resolvers: [ElementPlusResolver(), IconsResolver()],
|
|
|
- }),
|
|
|
- Icons({
|
|
|
- compiler: 'vue3',
|
|
|
- autoInstall: true,
|
|
|
- }),
|
|
|
- // https://github.com/antfu/unocss
|
|
|
- // see unocss.config.ts for config
|
|
|
- ],
|
|
|
+ // https://github.com/antfu/vite-plugin-components
|
|
|
+ Components({
|
|
|
+ dts: true,
|
|
|
+ resolvers: [ElementPlusResolver(), IconsResolver()],
|
|
|
+ }),
|
|
|
+ Icons({
|
|
|
+ compiler: 'vue3',
|
|
|
+ autoInstall: true,
|
|
|
+ }),
|
|
|
+ // https://github.com/antfu/unocss
|
|
|
+ // see unocss.config.ts for config
|
|
|
+ ],
|
|
|
+
|
|
|
+ // https://github.com/vitest-dev/vitest
|
|
|
+ test: {
|
|
|
+ environment: 'jsdom',
|
|
|
+ },
|
|
|
+ }
|
|
|
+ if(command === 'build') {
|
|
|
+ cfg.base = '/webapps/page/liankao/'
|
|
|
+ return cfg
|
|
|
+ } else {
|
|
|
+ return cfg
|
|
|
+ }
|
|
|
|
|
|
- // https://github.com/vitest-dev/vitest
|
|
|
- test: {
|
|
|
- environment: 'jsdom',
|
|
|
- },
|
|
|
})
|