title: How to use dotenv in SvelteKit project?
body: <p>I'm trying to use dotenv.config() in a SvelteKit project.</p>
  <p>I can run <code>npm run build</code> successfully. But when I try to start the server (using <code>node build</code>), it throws <code>Error: Dynamic require of &quot;fs&quot; is not supported</code>.</p>
  <p>I tried to comment out the dotenv part in <code>src/routes/test.js</code> and build again, and this time the server started without any errors. (I created the project with <code>npm init svelte@next</code> without typescript, and except for the codes here, nothing else is changed)</p>
  <p>How should I use dotenv here to load environment variables at runtime?</p>
  <p>svelte.config.js</p>
  <pre class="lang-js prettyprint-override"><code>import node from '@sveltejs/adapter-node';
  
  const config = {
      kit: {
          adapter: node(),
          target: '#svelte'
      }
  };
  
  export default config;
  </code></pre>
  <p>/src/routes/test.js</p>
  <pre class="lang-js prettyprint-override"><code>import dotenv from 'dotenv';
  
  dotenv.config();
  
  export function get() {
      return {
          body: {
              test: process.env.TEST
          }
      }
  }
  </code></pre>
  <p>.env</p>
  <pre><code>TEST=123
  </code></pre>