diff --git a/package-lock.json b/package-lock.json index 4b1e6967..3121e7b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,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", @@ -42,18 +41,15 @@ "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" }, "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" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -12893,6 +12889,18 @@ "fsevents": "~2.3.2" } }, + "node_modules/vite-plugin-externalize-deps": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/vite-plugin-externalize-deps/-/vite-plugin-externalize-deps-0.8.0.tgz", + "integrity": "sha512-MdC8kRNQ1ZjhUicU2HcqGVhL0UUFqv83Zp1JZdHjE82PoPR8wsSWZ3axpot7B6img3sW6g8shYJikE0CKA0chA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/voracious" + }, + "peerDependencies": { + "vite": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0" + } + }, "node_modules/vt-pbf": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", diff --git a/package.json b/package.json index 23b6f041..9fb7547c 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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" } } diff --git a/vite.config.ts b/vite.config.ts index a11fd228..a35959f2 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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 @@ -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'], - }, }, });