2021-12-09 07:16:00 +03:00
|
|
|
import { defineConfig } from 'vite'
|
2022-07-04 04:15:23 +03:00
|
|
|
import Unocss from 'unocss/vite'
|
2021-12-09 07:16:00 +03:00
|
|
|
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
2022-08-20 22:53:07 +03:00
|
|
|
import { internalIpV4 } from 'internal-ip'
|
2021-12-09 07:16:00 +03:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
2022-08-20 22:53:07 +03:00
|
|
|
export default defineConfig(async ({ command, mode }) => {
|
|
|
|
const host = await internalIpV4()
|
|
|
|
return {
|
|
|
|
plugins: [Unocss(), svelte()],
|
|
|
|
build: {
|
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
entryFileNames: `assets/[name].js`,
|
|
|
|
chunkFileNames: `assets/[name].js`,
|
|
|
|
assetFileNames: `assets/[name].[ext]`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
server: {
|
2022-08-23 18:40:02 +03:00
|
|
|
port: 5173,
|
|
|
|
strictPort: true,
|
2022-08-20 22:53:07 +03:00
|
|
|
hmr: {
|
|
|
|
host,
|
|
|
|
port: 5183
|
|
|
|
},
|
|
|
|
fs: {
|
|
|
|
allow: ['.', '../../tooling/api/dist']
|
2022-02-05 00:33:43 +03:00
|
|
|
}
|
2022-02-06 23:50:02 +03:00
|
|
|
}
|
2022-02-05 00:33:43 +03:00
|
|
|
}
|
2021-12-09 07:16:00 +03:00
|
|
|
})
|