@rpcbase/vite 0.13.0 → 0.15.0

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/index.js +15 -7
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -7,12 +7,14 @@ import {
7
7
  loadEnv,
8
8
  } from "vite"
9
9
 
10
+ import { sentryVitePlugin } from "@sentry/vite-plugin"
10
11
  import react from "@vitejs/plugin-react-swc"
11
12
  import { createHtmlPlugin } from "vite-plugin-html"
12
13
 
13
14
  const ALLOWED_DEV_ENV = ["NODE_ENV", "APP_NAME", "DB_NAME"]
14
15
 
15
16
  const isProduction = process.env.NODE_ENV === "production"
17
+ const isCI = process.env.CI === "true"
16
18
 
17
19
  // https://github.com/vbenjs/vite-plugin-html?tab=readme-ov-file#minifyoptions
18
20
  const htmlMinifyOptions = {
@@ -26,7 +28,6 @@ const htmlMinifyOptions = {
26
28
  minifyCSS: true,
27
29
  }
28
30
 
29
-
30
31
  export const resolveAliases = {
31
32
  "@/api": path.resolve(process.cwd(), "./src/api/"),
32
33
  "@/models": path.resolve(process.cwd(), "./src/models/"),
@@ -52,7 +53,6 @@ export const resolveAliases = {
52
53
 
53
54
  // https://vite.dev/config/
54
55
  const getBaseConfig = ({ command, mode, isSsrBuild, isPreview }) => {
55
-
56
56
  // workaround vite.ssrLoadModule not setting ssrBuild properly
57
57
  const allowedEnvPrefixes = [
58
58
  "RB_PUBLIC_",
@@ -63,12 +63,20 @@ const getBaseConfig = ({ command, mode, isSsrBuild, isPreview }) => {
63
63
 
64
64
  return {
65
65
  clearScreen: false,
66
- plugins: [react(), createHtmlPlugin({
67
- // IMPORTANT: minify removes comments by default, which are used by the app ssr
68
- minify: htmlMinifyOptions,
69
- })],
66
+ plugins: [
67
+ react(),
68
+ createHtmlPlugin({
69
+ // IMPORTANT: minify removes comments by default, which are used by the app ssr
70
+ minify: htmlMinifyOptions,
71
+ }),
72
+ isCI && sentryVitePlugin({
73
+ org: process.env.SENTRY_ORG,
74
+ project: process.env.SENTRY_PROJECT,
75
+ authToken: process.env.SENTRY_AUTH_TOKEN,
76
+ }),
77
+ ].filter(Boolean),
70
78
  define: {
71
- "__vite_env__": {
79
+ __vite_env__: {
72
80
  ...env,
73
81
  },
74
82
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/vite",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "scripts": {
@@ -24,6 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
+ "@sentry/vite-plugin": "3.3.1",
27
28
  "@swc/core": "1.11.7",
28
29
  "@tailwindcss/vite": "4.0.12",
29
30
  "@vitejs/plugin-react-swc": "3.8.0",