Skip to content

Commit

Permalink
Move to peer dependencies
Browse files Browse the repository at this point in the history
Also add vite for building as we want to make stand-alone
  • Loading branch information
nathanfranklin committed Oct 15, 2024
1 parent 4077f0c commit 2fd6685
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
16 changes: 11 additions & 5 deletions libs/core-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,22 @@
"dist"
],
"homepage": "https://github.com/TACC/tup-ui/libs/core-components",
"scripts": {
"build": "vite build --outDir dist"
},
"dependencies": {
"uuid": "^8.3.2"
},
"peerDependencies": {
"formik": "^2.2.9",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-resize-detector": "^7.1.2",
"react-router-dom": "6.11.2",
"react-router-dom": "^6.11.2",
"react-step-wizard": "^5.3.11",
"react-table": "^7.8.0",
"reactstrap": "^9.1.5",
"uuid": "^8.3.2"
"reactstrap": "^9.1.5"
},
"devDependencies": {
"@nx/react": "^17.2.8",
Expand All @@ -31,6 +36,7 @@
"@testing-library/user-event": "^14.5.2",
"@vitejs/plugin-react-swc": "^3.5.0",
"uuid": "^8.3.2",
"vite": "^5.0.11",
"vite-plugin-dts": "^2.3.0",
"vite-plugin-lib-inject-css": "^2.1.1",
"vite-tsconfig-paths": "^4.2.0"
Expand Down
9 changes: 8 additions & 1 deletion libs/core-components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ export default defineConfig({
],

build: {
sourcemap: true,
reportCompressedSize: true,
lib: {
entry: resolve(__dirname, 'src/index.ts'),
formats: ['es'],
},
rollupOptions: {
external: ['react', 'react/jsx-runtime'],
treeshake:true,
external: ['react', 'react-dom', 'react-router-dom', 'react-router', 'react/jsx-runtime'],
input: Object.fromEntries(
// https://rollupjs.org/configuration-options/#input
glob
Expand All @@ -48,6 +50,11 @@ export default defineConfig({
])
),
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'react-router-dom': 'ReactRouterDOM',
},
assetFileNames: 'assets/[name][extname]',
entryFileNames: '[name].js',
},
Expand Down

0 comments on commit 2fd6685

Please sign in to comment.