build: 2 setup library build mode and compile dist
This commit is contained in:
parent
735217efc5
commit
24e85d898f
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user