Skip to content

Commit

Permalink
fix: change config to use vite plugin externaldeps
Browse files Browse the repository at this point in the history
Signed-off-by: LE SAULNIER Kevin <[email protected]>
  • Loading branch information
LE SAULNIER Kevin committed Jan 30, 2024
1 parent 23f4180 commit 200142d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
22 changes: 15 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"dependencies": {
"@mui/icons-material": "^5.5.1",
"@mui/material": "^5.5.3",
"@mui/system": "^5.5.3",
"@svgdotjs/svg.js": "^3.0.12",
"@svgdotjs/svg.panzoom.js": "^2.1.2",
"cheap-ruler": "^3.0.0",
Expand All @@ -35,13 +34,9 @@
"peerDependencies": {
"@emotion/styled": "^11.8.1",
"@mui/system": "^5.5.3",
"deck.gl": "^8.9.18",
"geolib": "^3.3.4",
"mapbox-gl": "^3.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-intl": "^6.0.0",
"react-map-gl": "^7.0.0"
"react-intl": "^6.0.0"
},
"devDependencies": {
"@babel/core": "^7.17.10",
Expand All @@ -65,6 +60,7 @@
"typescript": "^5.0.4",
"vite": "^5.0.11",
"vite-plugin-dts": "^3.7.1",
"vite-plugin-eslint": "^1.8.1"
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-externalize-deps": "^0.8.0"
}
}
15 changes: 9 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ import { resolve } from 'path';
import eslint from 'vite-plugin-eslint';
import dts from 'vite-plugin-dts';
import react from '@vitejs/plugin-react';
import { externalizeDeps } from 'vite-plugin-externalize-deps';

export default defineConfig({
plugins: [react(), eslint(), dts()],
plugins: [
react(),
eslint(),
dts(),
externalizeDeps({
deps: false,
}),
],
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
Expand All @@ -15,10 +23,5 @@ export default defineConfig({
fileName: 'powsybl-diagram-viewer',
formats: ['es'],
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['react', 'react-dom', 'react-intl', '@mui/system'],
},
},
});

0 comments on commit 200142d

Please sign in to comment.