Skip to content

Commit

Permalink
Fix build sdk-analytics (#31006)
Browse files Browse the repository at this point in the history
### Proposed Changes
* Fix build details

### Checklist
- [ ] Tests
- [ ] Translations
- [ ] Security Implications Contemplated (add notes if applicable)

### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **
  • Loading branch information
oidacra authored Dec 26, 2024
1 parent 316f67a commit 62751aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core-web/libs/sdk/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
},
"homepage": "https://github.com/dotCMS/core/tree/main/core-web/libs/sdk/analytics/README.md",
"dependencies": {
"analytics": "^0.8.14",
"vite": "~5.0.0"
"analytics": "^0.8.14"
},
"peerDependencies": {
"react": "^18.2.0"
},
"devDependencies": {
"vite": "~5.0.0",
"@testing-library/jest-dom": "^6.1.6",
"@testing-library/react": "^14.0.0"
},
Expand Down
14 changes: 4 additions & 10 deletions core-web/libs/sdk/analytics/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,13 @@ export default defineConfig({
copyReadme
],

// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },

// Configuration for building your library.
// See: https://vitejs.dev/guide/build.html#library-mode
build: {
outDir: '../../../dist/libs/sdk/analytics',
emptyOutDir: true,
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true
transformMixedEsModules: true,
requireReturnsDefault: 'auto'
},
lib: {
entry: {
Expand All @@ -50,13 +44,13 @@ export default defineConfig({
formats: ['es']
},
rollupOptions: {
external: ['react', 'react-dom', 'react/jsx-runtime'],
external: ['react', 'react-dom', 'react/jsx-runtime', 'analytics'],
output: {
exports: 'named',
preserveModules: true,
preserveModulesRoot: 'src',
entryFileNames: '[name].js',
chunkFileNames: '[name].js'
chunkFileNames: 'chunks/[name].js'
}
}
}
Expand Down

0 comments on commit 62751aa

Please sign in to comment.