From 24e85d898f433447c67a97fb917c6dd0a25302e4 Mon Sep 17 00:00:00 2001 From: firmansyah Date: Mon, 18 May 2026 16:56:09 +0700 Subject: [PATCH] build: 2 setup library build mode and compile dist --- vite.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vite.config.js b/vite.config.js index 4d05008..bf1f109 100644 --- a/vite.config.js +++ b/vite.config.js @@ -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'