build: 2 setup library build mode and compile dist

This commit is contained in:
Firman Syah 2026-05-18 16:56:09 +07:00
parent 735217efc5
commit 24e85d898f

View File

@ -6,16 +6,16 @@ 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)
formats: ['es']
},
rollupOptions: {
// Don't bundle react or react-dom into your library
external: ['react', 'react-dom'],
output: {
// Force explicit named exports matching your source code
exports: 'named',
globals: {
react: 'React',
'react-dom': 'ReactDOM'