Skip to content

Commit

Permalink
Merge branch 'upgrade-reactmapgl-deckgl' into fix-code
Browse files Browse the repository at this point in the history
  • Loading branch information
LE SAULNIER Kevin committed Feb 6, 2024
2 parents 200142d + 5fceacc commit aab221a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 14 deletions.
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@
"homepage": "https://www.powsybl.org/",
"license": "MPL",
"repository": "git://github.com/powsybl/powsybl-diagram-viewer.git",
"types": "dist/index.d.ts",
"type": "module",
"main": "dist/powsybl-diagram-viewer.js",
"exports": "./dist/powsybl-diagram-viewer.js",
"types": "./dist/index.d.ts",
"main": "./dist/powsybl-diagram-viewer.umd.cjs",
"module": "./dist/powsybl-diagram-viewer.js",
"exports": {
".": {
"import": "./dist/powsybl-diagram-viewer.js",
"require": "./dist/powsybl-diagram-viewer.umd.cjs"
}
},
"files": [
"/dist"
"dist"
],
"scripts": {
"watch": "vite watch",
"build": "vite build",
"test": "jest",
"start": "vite demo/ --open",
"start": "vite demo/src/ --config vite.config.ts --open",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
Expand Down
39 changes: 30 additions & 9 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,43 @@ import react from '@vitejs/plugin-react';
import { externalizeDeps } from 'vite-plugin-externalize-deps';

export default defineConfig({
plugins: [
react(),
eslint(),
dts(),
externalizeDeps({
deps: false,
}),
],
plugins: [react(), eslint(), dts(), externalizeDeps()],
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, 'src/index.js'),
name: 'Powsybl diagram viewer',
// the proper extensions will be added
fileName: 'powsybl-diagram-viewer',
formats: ['es'],
},
rollupOptions: {
output: {
// DO NOT define any external deps. External deps are dealt with externalizeDeps from vite-plugin-externalize-deps
// defining externals manually will prevent this plugin from working
// external:
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
react: 'React',
'react/jsx-runtime': 'ReactJsxRuntime',
'react-intl': 'ReactIntl',
'@emotion/react': 'EmotionReact',
'@svgdotjs/svg.js': 'SvgJs',
'geolib/es/computeDestinationPoint':
'GeolibComputeDestinationpoint',
'cheap-ruler': 'CheapRuler',
'geolib/es/getGreatCircleBearing':
'GeolibGetGreatCircleBearing',
'geolib/es/getRhumbLineBearing':
'GeolibGetRhumbLineBearing',
'deck.gl': 'DeckGl',
'geolib/es/getDistance': 'GeolibGetDistance',
'react-map-gl': 'ReactMapGl',
'@mui/system': 'MuiSystem',
'@mui/material': 'MuiMaterial',
'@mui/icons-material/Replay': 'MuiIconsMaterialReplay',
},
},
},
},
});

0 comments on commit aab221a

Please sign in to comment.