mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 09:30:31 +03:00
26 lines
741 B
TypeScript
26 lines
741 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { VitePWA } from 'vite-plugin-pwa';
|
|
import { manifest } from './manifest';
|
|
import pack from './package.json';
|
|
|
|
const homepage = pack.homepage?.trim();
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), VitePWA({
|
|
mode: process.env.NODE_ENV === 'development' ? 'development' : 'production',
|
|
strategies: 'injectManifest',
|
|
srcDir: './src',
|
|
filename: 'service-worker.ts',
|
|
injectRegister: false,
|
|
manifestFilename: 'manifest.json',
|
|
manifest,
|
|
})],
|
|
build: {
|
|
outDir: 'build',
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
},
|
|
base: !homepage ? undefined : homepage, // Not using just homepage because empty string should be discarded
|
|
});
|