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