2024-06-10 19:35:19 -05:00
|
|
|
import {readFileSync} from 'node:fs';
|
|
|
|
import {fileURLToPath} from 'node:url';
|
2024-06-10 22:42:30 -05:00
|
|
|
|
2024-06-10 19:35:19 -05:00
|
|
|
import {vitePlugin as remix} from '@remix-run/dev';
|
2024-06-10 22:42:30 -05:00
|
|
|
import react from '@vitejs/plugin-react';
|
2024-06-10 19:35:19 -05:00
|
|
|
import {defineConfig} from 'vite';
|
|
|
|
|
|
|
|
const cacheDirectory = `${import.meta.dirname}/node_modules/.cache`;
|
2024-06-10 14:47:05 -05:00
|
|
|
|
2024-06-10 22:42:30 -05:00
|
|
|
const plugins = [];
|
|
|
|
|
|
|
|
if (!process.env.STORYBOOK) {
|
|
|
|
plugins.push(
|
2024-06-10 14:47:05 -05:00
|
|
|
remix({
|
|
|
|
future: {
|
|
|
|
v3_fetcherPersist: true,
|
|
|
|
v3_relativeSplatPath: true,
|
|
|
|
v3_throwAbortReason: true,
|
|
|
|
},
|
|
|
|
}),
|
2024-06-10 22:42:30 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
plugins.push(react());
|
|
|
|
}
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
plugins,
|
2024-06-10 19:35:19 -05:00
|
|
|
resolve: {
|
|
|
|
alias: [
|
|
|
|
{
|
|
|
|
find: '@',
|
|
|
|
replacement: fileURLToPath(new URL('./app', import.meta.url))
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
server: {
|
|
|
|
https: {
|
|
|
|
key: readFileSync(`${cacheDirectory}/localhost-key.pem`),
|
|
|
|
cert: readFileSync(`${cacheDirectory}/localhost.pem`),
|
|
|
|
},
|
|
|
|
},
|
2024-06-10 14:47:05 -05:00
|
|
|
});
|