Skip to content

Instantly share code, notes, and snippets.

@rw3iss
Created November 16, 2023 17:27
Show Gist options
  • Save rw3iss/b8fdb633193ecc4d2af88e7b7fa1066e to your computer and use it in GitHub Desktop.
Save rw3iss/b8fdb633193ecc4d2af88e7b7fa1066e to your computer and use it in GitHub Desktop.
vite config
import react from '@vitejs/plugin-react-swc';
import path from 'path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import { libInjectCss } from 'vite-plugin-lib-inject-css';
//import reactJsx from 'vite-react-jsx';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
//reactJsx(),
libInjectCss(),
dts()
],
build: {
rollupOptions: {
//external: ['react/jsx-runtime'],
output: {
//format: 'es',
// Provide global variables to use in the UMD build
// for externalized deps
// globals: {
// react: 'react',
// },
// interop: 'auto'
}
},
// lib: {
// name: 'BlobsWebApp',
// entry: resolve(__dirname, 'src/index.ts'),
// formats: ['es', 'cjs']
// }
},
resolve: {
//dedupe: ['react'],
alias: {
'@': path.resolve(__dirname, './src'),
'lib': path.resolve(__dirname, './src/lib'),
'components': path.resolve(__dirname, './src/components'),
'pages': path.resolve(__dirname, './src/pages'),
'services': path.resolve(__dirname, './src/services'),
'helpers': path.resolve(__dirname, './src/helpers'),
'stores': path.resolve(__dirname, './src/data/stores'),
'models': path.resolve(__dirname, './src/data/models'),
'types': path.resolve(__dirname, './src/data/types'),
'utils': path.resolve(__dirname, './src/lib/utils'),
'styles': path.resolve(__dirname, './src/styles'),
'public': path.resolve(__dirname, './public'),
'sdk': path.resolve(__dirname, '../sdk')
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment