@brainfish-ai/web-tracker 0.0.4-alpha.7 → 0.0.4-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -2
  2. package/vite.config.ts +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainfish-ai/web-tracker",
3
- "version": "0.0.4-alpha.7",
3
+ "version": "0.0.4-alpha.8",
4
4
  "module": "index.ts",
5
5
  "description": "Brainfish Tracker for Web",
6
6
  "private": false,
@@ -25,7 +25,8 @@
25
25
  "@brainfish-ai/tracker-sdk": "0.0.1-alpha.2",
26
26
  "html-to-image": "^1.11.11",
27
27
  "redact-pii": "^3.4.0",
28
- "rrweb": "^2.0.0-alpha.4"
28
+ "rrweb": "^2.0.0-alpha.4",
29
+ "vite-plugin-replace": "^0.1.1"
29
30
  },
30
31
  "keywords": [
31
32
  "typescript",
package/vite.config.ts CHANGED
@@ -4,6 +4,8 @@ import dts from 'vite-plugin-dts';
4
4
  import compression from 'vite-plugin-compression';
5
5
  import { visualizer } from 'rollup-plugin-visualizer';
6
6
  import tsconfigPaths from 'vite-tsconfig-paths';
7
+ import { replaceCodePlugin } from 'vite-plugin-replace';
8
+ import { version } from './package.json';
7
9
 
8
10
  export default defineConfig({
9
11
  plugins: [
@@ -15,6 +17,14 @@ export default defineConfig({
15
17
  }),
16
18
  compression(),
17
19
  visualizer(),
20
+ replaceCodePlugin({
21
+ replacements: [
22
+ {
23
+ from: "__PACKAGE_VERSION__",
24
+ to: `"${version}"`,
25
+ },
26
+ ],
27
+ }),
18
28
  ],
19
29
  build: {
20
30
  target: 'esnext',
@@ -41,7 +51,7 @@ export default defineConfig({
41
51
  environment: 'jsdom',
42
52
  },
43
53
  define: {
44
- __PACKAGE_VERSION__: JSON.stringify(process.env.npm_package_version),
54
+ __PACKAGE_VERSION__: version,
45
55
  },
46
56
  optimizeDeps: {
47
57
  include: ['@brainfish-ai/tracker-sdk'],