44 lines
927 B
TypeScript
44 lines
927 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { viteSingleFile } from 'vite-plugin-singlefile';
|
|
import path from 'path';
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
viteSingleFile({
|
|
removeViteModuleLoader: true
|
|
})
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src')
|
|
}
|
|
},
|
|
css: {
|
|
modules: {
|
|
localsConvention: 'camelCase',
|
|
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
|
},
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `@use "@/styles/variables.scss" as *;`
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
target: 'es2015',
|
|
outDir: 'dist',
|
|
assetsInlineLimit: 100000000,
|
|
chunkSizeWarningLimit: 100000000,
|
|
cssCodeSplit: false,
|
|
rollupOptions: {
|
|
output: {
|
|
inlineDynamicImports: true,
|
|
manualChunks: undefined
|
|
}
|
|
}
|
|
}
|
|
});
|