One of the steps to address #8128 How to test: Please change the locale in the settings and click on change password button. A password reset email in the preferred locale will be sent.   Todo: - Remove the hardcoded locales for invitation, warn suspended workspace email, clean suspended workspace emails - Need to test invitation, email verification, warn suspended workspace email, clean suspended workspace emails - The duration variable `5 minutes` is always in english. Do we need to do something about that? It does seems odd in case of chinese translations. Notes: - Only tested the password reset , password update notify templates. - Cant test email verification due to error during sign up `Internal server error: New workspace setup is disabled` --------- Co-authored-by: Félix Malfait <felix@twenty.com>
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { lingui } from '@lingui/vite-plugin';
|
|
import react from '@vitejs/plugin-react-swc';
|
|
import * as path from 'path';
|
|
import { APP_LOCALES } from 'twenty-shared';
|
|
import { defineConfig } from 'vite';
|
|
import dts from 'vite-plugin-dts';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
export default defineConfig({
|
|
root: __dirname,
|
|
cacheDir: '../../node_modules/.vite/packages/twenty-emails',
|
|
|
|
plugins: [
|
|
react({
|
|
plugins: [['@lingui/swc-plugin', {}]],
|
|
}),
|
|
lingui({
|
|
configPath: path.resolve(__dirname, './lingui.config.ts'),
|
|
}),
|
|
tsconfigPaths(),
|
|
dts({
|
|
entryRoot: 'src',
|
|
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
|
|
}),
|
|
],
|
|
|
|
// Configuration for building your library.
|
|
// See: https://vitejs.dev/guide/build.html#library-mode
|
|
build: {
|
|
outDir: './dist',
|
|
reportCompressedSize: true,
|
|
commonjsOptions: {
|
|
transformMixedEsModules: true,
|
|
},
|
|
lib: {
|
|
entry: {
|
|
index: 'src/index.ts',
|
|
...Object.values(APP_LOCALES).reduce(
|
|
(acc, locale) => ({
|
|
...acc,
|
|
[`locales/generated/${locale}`]: `src/locales/generated/${locale}.ts`,
|
|
}),
|
|
{},
|
|
),
|
|
},
|
|
name: 'twenty-emails',
|
|
formats: ['es', 'cjs'],
|
|
},
|
|
rollupOptions: {
|
|
external: ['react', 'react-dom', 'react/jsx-runtime'],
|
|
},
|
|
},
|
|
});
|