mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-29 11:16:34 +08:00
v2.0
This commit is contained in:
22
web/build/vite/plugin/styleImport.ts
Normal file
22
web/build/vite/plugin/styleImport.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Introduces component library styles on demand.
|
||||
* https://github.com/anncwb/vite-plugin-style-import
|
||||
*/
|
||||
|
||||
import styleImport from 'vite-plugin-style-import';
|
||||
|
||||
export function configStyleImportPlugin(isBuild: boolean) {
|
||||
if (!isBuild) return [];
|
||||
const styleImportPlugin = styleImport({
|
||||
libs: [
|
||||
{
|
||||
libraryName: 'ant-design-vue',
|
||||
esModule: true,
|
||||
resolveStyle: (name) => {
|
||||
return `ant-design-vue/es/${name}/style/index`;
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
return styleImportPlugin;
|
||||
}
|
Reference in New Issue
Block a user