@rpcbase/vite 0.12.0 → 0.14.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 -9
  2. package/package.json +4 -1
package/index.js CHANGED
@@ -7,14 +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
- // @ts-ignore
13
- import tailwindcss from "@tailwindcss/vite"
14
13
 
15
14
  const ALLOWED_DEV_ENV = ["NODE_ENV", "APP_NAME", "DB_NAME"]
16
15
 
17
16
  const isProduction = process.env.NODE_ENV === "production"
17
+ const isCI = process.env.CI === "true"
18
18
 
19
19
  // https://github.com/vbenjs/vite-plugin-html?tab=readme-ov-file#minifyoptions
20
20
  const htmlMinifyOptions = {
@@ -28,7 +28,6 @@ const htmlMinifyOptions = {
28
28
  minifyCSS: true,
29
29
  }
30
30
 
31
-
32
31
  export const resolveAliases = {
33
32
  "@/api": path.resolve(process.cwd(), "./src/api/"),
34
33
  "@/models": path.resolve(process.cwd(), "./src/models/"),
@@ -54,7 +53,6 @@ export const resolveAliases = {
54
53
 
55
54
  // https://vite.dev/config/
56
55
  const getBaseConfig = ({ command, mode, isSsrBuild, isPreview }) => {
57
-
58
56
  // workaround vite.ssrLoadModule not setting ssrBuild properly
59
57
  const allowedEnvPrefixes = [
60
58
  "RB_PUBLIC_",
@@ -65,12 +63,20 @@ const getBaseConfig = ({ command, mode, isSsrBuild, isPreview }) => {
65
63
 
66
64
  return {
67
65
  clearScreen: false,
68
- plugins: [react(), tailwindcss(), createHtmlPlugin({
69
- // IMPORTANT: minify removes comments by default, which are used by the app ssr
70
- minify: htmlMinifyOptions,
71
- })],
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),
72
78
  define: {
73
- "__vite_env__": {
79
+ __vite_env__: {
74
80
  ...env,
75
81
  },
76
82
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/vite",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "scripts": {
@@ -40,5 +40,8 @@
40
40
  "vite": "6.2.1",
41
41
  "vite-plugin-html": "3.2.2",
42
42
  "zod": "3.24.2"
43
+ },
44
+ "devDependencies": {
45
+ "@sentry/vite-plugin": "3.3.1"
43
46
  }
44
47
  }