import{sveltekit}from"@sveltejs/kit/vite";import fetchGraphQLSchema from"@magidoc/rollup-plugin-fetch-gql-schema";import{magidoc}from"@magidoc/plugin-starter-variables";import{ENV_FILE_LOCATION,loadVariables}from"./magidoc.config.js";import fs from"fs";import path from"path";const variables=loadVariables(),config={plugins:[magidoc.MAGIDOC_GENERATE.get(variables)?null:fetchGraphQLSchema({url:"https://graphiql-test.netlify.app/.netlify/functions/schema-demo"}),{name:"init-variables",buildStart:()=>{fs.existsSync(ENV_FILE_LOCATION)||fs.writeFileSync(ENV_FILE_LOCATION,"{}")}},sveltekit(),{name:"variables-change-handler",handleHotUpdate:e=>e.file.includes(ENV_FILE_LOCATION.replace("./",""))?(e.server.ws.send({type:"custom",event:"variables-changed"}),[]):e.modules}].filter((e=>!!e)),ssr:{noExternal:["prettier","prismjs","marked"]}};export default config;