-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added whitelist domains into vite.config.js
- Loading branch information
Showing
1 changed file
with
44 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,44 @@ | ||
import { sveltekit } from '@sveltejs/kit/vite' | ||
import { defineConfig, loadEnv } from 'vite' | ||
// import { join } from 'path' | ||
// import { partytownVite } from '@builder.io/partytown/utils' | ||
import { SvelteKitPWA } from '@vite-pwa/sveltekit' | ||
/** @type {import('vite').UserConfig} */ | ||
export default defineConfig(({ command, mode }) => { | ||
const env = loadEnv(mode, process.cwd(), '') | ||
const HTTP_ENDPOINT = env.PUBLIC_LITEKART_API_URL || 'https://api.litekart.in' | ||
return { | ||
plugins: [ | ||
sveltekit(), | ||
SvelteKitPWA({ | ||
registerType: 'autoUpdate', | ||
workbox: { | ||
globPatterns: ['**/*.{ico,png,svg,webp}'] | ||
}, | ||
srcDir: './src', | ||
// mode: 'development', | ||
scope: '/', | ||
base: '/', | ||
devOptions: { | ||
// enabled: true, | ||
type: 'module', | ||
navigateFallback: '/' | ||
}, | ||
// if you have shared info in svelte config file put in a separate module and use it also here | ||
kit: {} | ||
}) | ||
// partytownVite({ | ||
// dest: join(process.cwd(), 'static', '~partytown') | ||
// }) | ||
], | ||
server: { | ||
host: true, | ||
port: 3000, | ||
proxy: { | ||
'/api': HTTP_ENDPOINT, | ||
'/sitemap': 'https://s3.ap-south-1.amazonaws.com/litekart.in' | ||
} | ||
} | ||
} | ||
}) | ||
import { sveltekit } from '@sveltejs/kit/vite' | ||
import { defineConfig, loadEnv } from 'vite' | ||
// import { join } from 'path' | ||
// import { partytownVite } from '@builder.io/partytown/utils' | ||
import { SvelteKitPWA } from '@vite-pwa/sveltekit' | ||
/** @type {import('vite').UserConfig} */ | ||
export default defineConfig(({ command, mode }) => { | ||
const env = loadEnv(mode, process.cwd(), '') | ||
const HTTP_ENDPOINT = env.PUBLIC_LITEKART_API_URL || 'https://api.litekart.in' | ||
return { | ||
plugins: [ | ||
sveltekit(), | ||
SvelteKitPWA({ | ||
registerType: 'autoUpdate', | ||
workbox: { | ||
globPatterns: ['**/*.{ico,png,svg,webp}'] | ||
}, | ||
srcDir: './src', | ||
// mode: 'development', | ||
scope: '/', | ||
base: '/', | ||
devOptions: { | ||
// enabled: true, | ||
type: 'module', | ||
navigateFallback: '/' | ||
}, | ||
// if you have shared info in svelte config file put in a separate module and use it also here | ||
kit: {} | ||
}) | ||
// partytownVite({ | ||
// dest: join(process.cwd(), 'static', '~partytown') | ||
// }) | ||
], | ||
server: { | ||
host: true, | ||
port: 3000, | ||
allowedHosts: ['*.litekart.in'], | ||
proxy: { | ||
'/api': HTTP_ENDPOINT, | ||
'/sitemap': 'https://s3.ap-south-1.amazonaws.com/litekart.in' | ||
} | ||
} | ||
} | ||
}) |