-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
52 lines (50 loc) · 1.38 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/**
* Copyright (c) 2023-present, NDLA.
*
* This source code is licensed under the GPLv3 license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import { defineConfig, splitVendorChunkPlugin } from "vite";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import react from "@vitejs/plugin-react";
export default defineConfig(() => {
return {
test: {
include: ["src/**/__tests__/*-test.(js|jsx|ts|tsx)"],
environment: "jsdom",
globals: true,
setupFiles: "./src/__tests__/vitest.setup.ts",
},
plugins: [
react({
babel: {
configFile: "./babel.config.cjs",
},
}),
splitVendorChunkPlugin(),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: process.env.SENTRY_ORG ?? "ndlano",
project: process.env.SENTRY_PROJECT ?? "ndla-frontend",
url: "https://sentry.io/",
telemetry: false,
}),
],
ssr: {
noExternal: ["@apollo/client"],
},
build: {
target: "es2020",
assetsDir: "static",
outDir: "build/public",
sourcemap: true,
rollupOptions: {
input: ["index.html", "lti.html", "iframe-article.html", "iframe-embed.html", "error.html"],
},
},
resolve: {
dedupe: ["react-router", "react-router-dom", "i18next", "react-i18next", "@ark-ui/react"],
},
};
});