26 lines
679 B
JavaScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
export default defineConfig({
plugins: [react()],
build: {
lib: {
// Point this to the file where your BaseButton component lives
entry: resolve(__dirname, 'src/App.jsx'),
name: 'OslogReactBaseComponent',
fileName: 'index',
formats: ['es'] // Outputs an ES Module (index.js)
},
rollupOptions: {
// Don't bundle react or react-dom into your library
external: ['react', 'react-dom'],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM'
}
}
}
}
});