review(front): refacto url-manager (#8861)
Replace https://github.com/twentyhq/twenty/pull/8855
This commit is contained in:
@ -19,7 +19,9 @@ export default defineConfig(({ command, mode }) => {
|
||||
VITE_BUILD_SOURCEMAP,
|
||||
VITE_DISABLE_TYPESCRIPT_CHECKER,
|
||||
VITE_DISABLE_ESLINT_CHECKER,
|
||||
VITE_ENABLE_SSL,
|
||||
VITE_HOST,
|
||||
SSL_CERT_PATH,
|
||||
SSL_KEY_PATH,
|
||||
REACT_APP_PORT,
|
||||
} = env;
|
||||
|
||||
@ -64,27 +66,24 @@ export default defineConfig(({ command, mode }) => {
|
||||
};
|
||||
}
|
||||
|
||||
if (VITE_ENABLE_SSL && (!env.SSL_KEY_PATH || !env.SSL_CERT_PATH)) {
|
||||
throw new Error(
|
||||
'to use https SSL_KEY_PATH and SSL_CERT_PATH must be both defined',
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
root: __dirname,
|
||||
cacheDir: '../../node_modules/.vite/packages/twenty-front',
|
||||
|
||||
server: {
|
||||
port: port,
|
||||
protocol: VITE_ENABLE_SSL ? 'https' : 'http',
|
||||
...(VITE_ENABLE_SSL
|
||||
...(VITE_HOST ? { host: VITE_HOST } : {}),
|
||||
...(SSL_KEY_PATH && SSL_CERT_PATH
|
||||
? {
|
||||
protocol: 'https',
|
||||
https: {
|
||||
key: fs.readFileSync(env.SSL_KEY_PATH),
|
||||
cert: fs.readFileSync(env.SSL_CERT_PATH),
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
: {
|
||||
protocol: 'http',
|
||||
}),
|
||||
fs: {
|
||||
allow: [
|
||||
searchForWorkspaceRoot(process.cwd()),
|
||||
|
||||
Reference in New Issue
Block a user