41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { resolve, dirname } from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig({
|
|
base: '/animal-island-ui/',
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
css: {
|
|
modules: {
|
|
generateScopedName: 'animal-[local]-[hash:base64:5]',
|
|
localsConvention: 'camelCase',
|
|
},
|
|
preprocessorOptions: {
|
|
less: {
|
|
javascriptEnabled: true,
|
|
additionalData: `@import "${resolve(__dirname, 'src/styles/variables.less')}";`,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'demo-dist',
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
vendor: ['react', 'react-dom'],
|
|
},
|
|
},
|
|
},
|
|
assetsInlineLimit: 4096,
|
|
},
|
|
});
|
|
|