mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-15 10:24:50 +00:00
12 lines
372 B
JavaScript
12 lines
372 B
JavaScript
import { Agent as HTTPSAgent } from 'node:https'
|
|
import { $fetch } from 'ofetch'
|
|
|
|
export const viteNodeOptions = JSON.parse(process.env.NUXT_VITE_NODE_OPTIONS || '{}')
|
|
|
|
export const viteNodeFetch = $fetch.create({
|
|
baseURL: viteNodeOptions.baseURL,
|
|
agent: viteNodeOptions.baseURL.startsWith('https://')
|
|
? new HTTPSAgent({ rejectUnauthorized: false })
|
|
: null
|
|
})
|