mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-30 23:23:47 +03:00
d14bb2ea11
* feat: configure eslint rules by replicating those in the twenty-front package and introduce scripts for linting, formatting code and removing build output * fix: ensure each file of the extension package satisfies linting rules and disable some rules where necessary * fix: update relative imports to absolute imports throughout extension code with the defined tilde and at symbols * fix: import the updated ui module from the front package to the chrome extension package to prevent eslint rules from breaking subject to the recent merged changes into main * fix: commit the case change for files that were missed by Git in the earlier commits due to default configuration
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { crx } from '@crxjs/vite-plugin';
|
|
import react from '@vitejs/plugin-react';
|
|
import { defineConfig, Plugin } from 'vite';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
import manifest from './src/manifest';
|
|
|
|
const viteManifestHack: Plugin & {
|
|
renderCrxManifest: (manifest: unknown, bundle: unknown) => void;
|
|
} = {
|
|
// Workaround from https://github.com/crxjs/chrome-extension-tools/issues/846#issuecomment-1861880919.
|
|
name: 'manifestHack',
|
|
renderCrxManifest: (_manifest, bundle: any) => {
|
|
bundle['manifest.json'] = bundle['.vite/manifest.json'];
|
|
bundle['manifest.json'].fileName = 'manifest.json';
|
|
delete bundle['.vite/manifest.json'];
|
|
},
|
|
};
|
|
|
|
export default defineConfig(() => {
|
|
return {
|
|
build: {
|
|
emptyOutDir: true,
|
|
outDir: 'dist',
|
|
rollupOptions: {
|
|
output: { chunkFileNames: 'assets/chunk-[hash].js' },
|
|
},
|
|
},
|
|
|
|
// Adding this to fix websocket connection error.
|
|
server: {
|
|
port: 3002,
|
|
strictPort: true,
|
|
hmr: { port: 3002 },
|
|
},
|
|
|
|
plugins: [viteManifestHack, crx({ manifest }), react(), tsconfigPaths()],
|
|
};
|
|
});
|