mirror of
https://github.com/sunniejs/vue-h5-template.git
synced 2025-04-05 07:03:01 +08:00
23 lines
535 B
TypeScript
23 lines
535 B
TypeScript
/**
|
|
* @name ConfigRestartPlugin
|
|
* @description 按需引入样式文件
|
|
*/
|
|
|
|
import { createStyleImportPlugin, Lib, VantResolve } from 'vite-plugin-style-import';
|
|
|
|
function NutuiResolve(): Lib {
|
|
return {
|
|
libraryName: '@nutui/nutui',
|
|
libraryNameChangeCase: 'pascalCase',
|
|
resolveStyle: (name) => {
|
|
return `@nutui/nutui/dist/packages/${name.toLowerCase()}/index.scss`;
|
|
},
|
|
};
|
|
}
|
|
|
|
export const ConfigStyleImport = () => {
|
|
return createStyleImportPlugin({
|
|
resolves: [NutuiResolve(), VantResolve()],
|
|
});
|
|
};
|