mirror of
https://github.com/twentyhq/twenty.git
synced 2026-08-02 10:43:08 -04:00
fix: Vite 8/Rolldown build warnings in library packages (#22205)
Clean up Vite 8/Rolldown build warnings that showed up during yarn start: - `twenty-client-sdk`: `relativeImportPath.ts` now imports `node:path`, so the generate bundle treats it as a Node external instead of stubbing it for the browser. - Remove rollup’s `interop: 'auto'` from CJS output options - Rolldown don’t support it and was showing `Invalid key: Expected never but received "interop"`. - Replaced deprecated `inlineDynamicImports: true` with `codeSplitting: false` in the worker config. References: - https://v7.vite.dev/guide/rolldown#option-validation-warnings - https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/22205?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> --------- Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
committed by
GitHub
parent
56deba351b
commit
6e319283c4
@@ -94,7 +94,6 @@ export default defineConfig(() => {
|
||||
},
|
||||
{
|
||||
format: 'cjs',
|
||||
interop: 'auto',
|
||||
esModule: true,
|
||||
exports: 'named',
|
||||
entryFileNames: (chunk) => entryFileNames(chunk, 'cjs'),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import path from 'path'
|
||||
import { relative } from 'node:path'
|
||||
|
||||
export const relativeImportPath = (from: string, to: string) => {
|
||||
const fromResolved = path.relative(from, to)
|
||||
const fromResolved = relative(from, to)
|
||||
return fromResolved[0] === '.' ? fromResolved : `./${fromResolved}`
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ export default defineConfig(() => {
|
||||
},
|
||||
{
|
||||
format: 'cjs',
|
||||
interop: 'auto',
|
||||
esModule: true,
|
||||
exports: 'named',
|
||||
entryFileNames: (chunk) => entryFileNames(chunk, 'cjs'),
|
||||
|
||||
@@ -30,7 +30,6 @@ export default defineConfig(() => {
|
||||
},
|
||||
{
|
||||
format: 'cjs',
|
||||
interop: 'auto',
|
||||
esModule: true,
|
||||
exports: 'named',
|
||||
entryFileNames: (chunk) => entryFileNames(chunk, 'cjs'),
|
||||
|
||||
@@ -19,7 +19,7 @@ export default defineConfig(() => {
|
||||
format: 'iife',
|
||||
rollupOptions: {
|
||||
output: {
|
||||
inlineDynamicImports: true,
|
||||
codeSplitting: false,
|
||||
},
|
||||
},
|
||||
plugins: () => [
|
||||
@@ -63,7 +63,6 @@ export default defineConfig(() => {
|
||||
},
|
||||
{
|
||||
format: 'cjs',
|
||||
interop: 'auto',
|
||||
esModule: true,
|
||||
exports: 'named',
|
||||
entryFileNames: '[name].cjs',
|
||||
|
||||
@@ -60,7 +60,6 @@ export default defineConfig(() => {
|
||||
},
|
||||
{
|
||||
format: 'cjs',
|
||||
interop: 'auto',
|
||||
esModule: true,
|
||||
exports: 'named',
|
||||
entryFileNames: (chunk) => {
|
||||
|
||||
@@ -78,7 +78,6 @@ export default defineConfig(() => {
|
||||
},
|
||||
{
|
||||
format: 'cjs' as const,
|
||||
interop: 'auto' as const,
|
||||
esModule: true,
|
||||
exports: 'named' as const,
|
||||
entryFileNames: '[name].cjs',
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// @ts-expect-error: no type declarations for path in this config
|
||||
import path from 'path';
|
||||
import { defineConfig } from 'vite';
|
||||
// @ts-expect-error: importing JSON without resolveJsonModule
|
||||
import packageJson from './package.json';
|
||||
|
||||
const moduleEntries = Object.keys((packageJson as any).exports || {})
|
||||
@@ -59,7 +57,6 @@ export default defineConfig(() => {
|
||||
},
|
||||
{
|
||||
format: 'cjs',
|
||||
interop: 'auto',
|
||||
esModule: true,
|
||||
exports: 'named',
|
||||
entryFileNames: (chunk) => entryFileNames(chunk, 'cjs'),
|
||||
|
||||
@@ -162,7 +162,6 @@ export default defineConfig(({ command }) => {
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
},
|
||||
interop: 'auto',
|
||||
esModule: true,
|
||||
exports: 'named',
|
||||
entryFileNames: (chunk) => entryFileNames(chunk, 'cjs'),
|
||||
|
||||
@@ -56,7 +56,6 @@ export default defineConfig(() => {
|
||||
output: [
|
||||
{
|
||||
format: 'cjs',
|
||||
interop: 'auto',
|
||||
esModule: true,
|
||||
exports: 'named',
|
||||
entryFileNames: (chunk) => entryFileNames(chunk, 'cjs'),
|
||||
|
||||
Reference in New Issue
Block a user