2023-04-02 01:01:56 +08:00
|
|
|
import vue from '@vitejs/plugin-vue';
|
|
|
|
import createUnoCss from './unocss';
|
|
|
|
import createAutoImport from './auto-import';
|
|
|
|
import createComponents from './components';
|
|
|
|
import createIcons from './icons';
|
|
|
|
import createSvgIconsPlugin from './svg-icon';
|
2023-04-02 15:07:14 +08:00
|
|
|
import createCompression from './compression';
|
2023-04-02 01:01:56 +08:00
|
|
|
import path from 'path';
|
|
|
|
|
2023-04-02 23:33:28 +08:00
|
|
|
export default (viteEnv: any, isBuild = false): [] => {
|
2023-04-02 01:01:56 +08:00
|
|
|
const vitePlusgins: any = [];
|
|
|
|
vitePlusgins.push(vue());
|
|
|
|
vitePlusgins.push(createUnoCss());
|
|
|
|
vitePlusgins.push(createAutoImport(path));
|
|
|
|
vitePlusgins.push(createComponents(path));
|
2023-04-02 15:07:14 +08:00
|
|
|
vitePlusgins.push(createCompression(viteEnv));
|
2023-04-02 01:01:56 +08:00
|
|
|
vitePlusgins.push(createIcons());
|
2023-04-02 15:07:14 +08:00
|
|
|
vitePlusgins.push(createSvgIconsPlugin(path, isBuild));
|
2023-04-02 01:01:56 +08:00
|
|
|
return vitePlusgins;
|
|
|
|
};
|