Skip to content

Commit

Permalink
feat(sdk-analytics) add standalone build
Browse files Browse the repository at this point in the history
  • Loading branch information
oidacra committed Dec 19, 2024
1 parent c427657 commit f083b0a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
11 changes: 11 additions & 0 deletions core-web/libs/sdk/analytics/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
"options": {
"jestConfig": "libs/sdk/analytics/jest.config.ts"
}
},
"build:standalone": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "../../core/dotCMS/src/main/resources/ca/html",
"main": "libs/sdk/analytics/src/lib/standalone.ts",
"tsConfig": "libs/sdk/analytics/tsconfig.lib.json",
"project": "libs/sdk/analytics/package.json",
"configFile": "libs/sdk/analytics/vite.standalone.config.mts"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { resolve } from 'path';

export default defineConfig({
root: __dirname,
cacheDir: '../../../node_modules/.vite/libs/sdk/sdk-analytics-3',
cacheDir: '../../../node_modules/.vite/libs/sdk/analytics',
plugins: [nxViteTsPaths()],
build: {
outDir: '../../../dist/libs/sdk/sdk-analytics-3',
outDir: '../../../dist/libs/sdk/analytics',
emptyOutDir: false,
reportCompressedSize: true,
lib: {
Expand All @@ -19,8 +19,10 @@ export default defineConfig({
formats: ['iife']
},
rollupOptions: {
external: ['react', 'react-dom', 'react/jsx-runtime', /^@dotcms\/analytics\/react/],
output: {
entryFileNames: 'ca.min.js'
entryFileNames: 'ca.min.js',
globals: {}
}
}
}
Expand Down

0 comments on commit f083b0a

Please sign in to comment.