This commit is contained in:
Ariful Alam
2022-03-24 22:22:45 +06:00
parent c453eb95fd
commit 07e1e090a1
5 changed files with 23 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import postcss from './postcss.config.js';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
@@ -11,4 +12,16 @@ export default defineConfig({
css: {
postcss,
},
build: {
lib: {
entry: path.resolve(__dirname, 'src/App.jsx'),
name: 'MyLib',
fileName: (format) => `my-lib.${format}.js`,
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['react', 'react-dom'],
},
},
});