Skip to content

Commit

Permalink
feat: Added whitelist domains into vite.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
itswadesh committed Jan 20, 2025
1 parent eee325d commit 36238e4
Showing 1 changed file with 44 additions and 43 deletions.
87 changes: 44 additions & 43 deletions vite.config.js
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'
}
}
}
})

0 comments on commit 36238e4

Please sign in to comment.