Files
twenty/packages/twenty-ui/vite.config.individual.ts
T
Raphaël Bosi c596a5e342 Rename twenty-ui to twenty-ui-deprecated and twenty-new-ui to twenty-ui to prepare package release (#21315)
## Description

Promotes the next-gen UI library (formerly `twenty-new-ui`) to the name
**`twenty-ui`** (v0.1.0, publishable) and renames the old package to
**`twenty-ui-deprecated`**. Rewrites ~1,730 `twenty-ui` imports →
`twenty-ui-deprecated`, updates all configs/CI/Docker/deps, and migrates
twenty-front's `Toggle` to the new package (first consumer) as a
drop-in.

## Next steps
- Wire the `ui/v*` publish dispatch (`cd-deploy-tag.yaml` +
`.yarnrc.yml`), then tag `ui/v0.1.0` to publish.
- Continue migrating components from `twenty-ui-deprecated` →
`twenty-ui`.
2026-06-08 18:12:28 +02:00

79 lines
2.0 KiB
TypeScript

import react from '@vitejs/plugin-react-swc';
import * as path from 'path';
import { defineConfig } from 'vite';
import svgr from 'vite-plugin-svgr';
import tsconfigPaths from 'vite-tsconfig-paths';
import packageJson from './package.json';
const depNames = Object.keys(packageJson.dependencies || {});
const isExternal = (id: string): boolean =>
depNames.some((dep) => id === dep || id.startsWith(dep + '/'));
export default defineConfig(() => {
return {
resolve: {
alias: {
'@new-ui/': path.resolve(__dirname, 'src') + '/',
'@assets/': path.resolve(__dirname, 'src/assets') + '/',
'@styles/': path.resolve(__dirname, 'src/styles') + '/',
},
},
css: {
modules: {
localsConvention: 'camelCaseOnly',
},
preprocessorOptions: {
scss: {
api: 'modern-compiler',
loadPaths: [path.resolve(__dirname, 'src/styles')],
additionalData: [
`@use 'abstracts/functions' as *;`,
`@use 'abstracts/mixins' as *;`,
`@use 'abstracts/breakpoints' as *;`,
'',
].join('\n'),
},
},
},
root: __dirname,
cacheDir: '../../node_modules/.vite/packages/twenty-ui-individual',
assetsInclude: ['src/**/*.svg'],
plugins: [
react(),
tsconfigPaths({
root: __dirname,
projects: ['tsconfig.json'],
}),
svgr(),
],
build: {
cssCodeSplit: false,
minify: 'esbuild',
sourcemap: true,
outDir: './dist/individual',
emptyOutDir: true,
commonjsOptions: {
transformMixedEsModules: true,
interopDefault: true,
defaultIsModuleExports: true,
requireReturnsDefault: 'auto',
},
lib: {
entry: 'src/individual-entry.ts',
formats: ['es'],
},
rollupOptions: {
external: isExternal,
output: {
preserveModules: true,
preserveModulesRoot: 'src',
entryFileNames: '[name].js',
},
},
},
logLevel: 'warn',
};
});