Skip to content

Commit 4d86771

Browse files
committed
exclude dependencies from bundle
1 parent 2b35b81 commit 4d86771

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

vite.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import react from '@vitejs/plugin-react';
22
import { resolve } from 'path';
3+
// @ts-expect-error no declaration file
4+
import excludeDependenciesFromBundle from 'rollup-plugin-exclude-dependencies-from-bundle';
35
import { defineConfig } from 'vite';
46
import dts from 'vite-plugin-dts';
57

68
// https://vitejs.dev/config/
79
export default defineConfig({
8-
plugins: [react(), dts({ include: ['src'] })],
10+
plugins: [react(), dts({ include: ['src'] }), excludeDependenciesFromBundle()],
911
build: {
1012
rollupOptions: {
11-
external: ['react', 'react/jsx-runtime'],
1213
output: {
1314
entryFileNames: '[name].js',
1415
},

0 commit comments

Comments
 (0)