adding a Vite SSR file
This commit is contained in:
parent
4dcb6b6ebe
commit
aa5753cc82
39
src/vite-ssr.config.js
Normal file
39
src/vite-ssr.config.js
Normal file
@ -0,0 +1,39 @@
|
||||
import fs from 'fs';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
|
||||
export default ({ mode }) => {
|
||||
process.env = Object.assign(process.env, loadEnv(mode, process.cwd(), ''));
|
||||
|
||||
return defineConfig({
|
||||
build: {
|
||||
reportCompressedSize: true,
|
||||
},
|
||||
plugins: [
|
||||
laravel({
|
||||
input: 'resources/js/app.js',
|
||||
ssr: 'resources/js/ssr.js',
|
||||
refresh: true,
|
||||
}),
|
||||
vue({
|
||||
template: {
|
||||
transformAssetUrls: {
|
||||
base: null,
|
||||
includeAbsolute: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
ssr: {
|
||||
noExternal: ['@inertiajs/server'],
|
||||
},
|
||||
server: {
|
||||
host: process.env.APP_DOMAIN,
|
||||
https: {
|
||||
key: fs.readFileSync(`${process.env.VITE_SSL_KEY_FILE_PATH}`),
|
||||
cert: fs.readFileSync(`${process.env.VITE_SSL_CERT_FILE_PATH}`),
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user