Files
classroomio/apps/dashboard/vite.config.ts
T
Adeyemi AdetunjiandRotimi Best cbf6ae7e63 feat: move away from carbon components and TinyMCE (#597)
* feat: remove tinymce & replace org sidebar

* chore: PR Fixes

* chore: move ui font into src dir

* remove files in vite config

* use google font import for loading font

* remove custom font

* more fonts update

* remove font bold

* more removals of font bold

* fix import

* checkpoint

* chore: checkpoint (add course & lms shadcn sidebar)

* minor css improvements and try out font sans

* chore: replace carbon components with shadcn's

* chore: replace carbon components with shadcn _ v3

* chore: ui fixes & storybook update

* feat: UI cleanup

* fix: quick ui fixes

* chore: update pnpm-lock.yaml with new dependencies and versions; fix output.css formatting

* chore: add isloading to button

* feat: add loading state to button stories

* chore: feedback fixes

* fix: feedback fixes

* chore: remove console

* fix: PR comments

* fix: PR comments

---------

Co-authored-by: Rotimi Best <[email protected]>
2025-11-21 12:18:04 +01:00

62 lines
1.4 KiB
TypeScript

import { defineConfig, loadEnv } from 'vite';
import fs from 'fs';
import { sveltekit } from '@sveltejs/kit/vite';
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
return defineConfig({
css: {
preprocessorOptions: {
scss: {
silenceDeprecations: ['legacy-js-api']
}
}
},
plugins: [sveltekit()],
server: getServer(process.env),
build: {
sourcemap: false
},
ssr: {
noExternal: ['svelte-sonner', 'layerchart']
},
optimizeDeps: {
entries: ['src/routes/**/+*.{js,ts,svelte}'],
include: ['@cio/api/rpc-types']
},
resolve: {
mainFields: ['browser']
}
});
};
function getServer(params) {
const { VITE_USE_HTTPS_ON_LOCALHOST } = params || {};
if (VITE_USE_HTTPS_ON_LOCALHOST === 'true') {
return {
https: {
key: fs.readFileSync(`${__dirname}/cert/key.pem`),
cert: fs.readFileSync(`${__dirname}/cert/cert.pem`)
}
};
}
}
// function getSentryConfig(params: any) {
// const { VITE_SENTRY_AUTH_TOKEN, VITE_SENTRY_ORG_NAME, VITE_SENTRY_PROJECT_NAME } = params || {};
// if (VITE_SENTRY_AUTH_TOKEN) {
// return {
// url: 'https://sentry.io',
// authToken: VITE_SENTRY_AUTH_TOKEN,
// org: VITE_SENTRY_ORG_NAME,
// project: VITE_SENTRY_PROJECT_NAME,
// options: {
// telemetry: false,
// }
// };
// }
// return {};
// }