title: 'require' is not defined - Sveltekit with typescript
body: <p>I'm using both 'import' and 'require' syntax in .ts files in a svelte project, and wondering why it's giving me 'require' is not defined error. I am wondering if there is a hole in my knowledge and am missing something simple?</p>
  <p>Tsconfig:</p>
  <pre><code>{
      &quot;compilerOptions&quot;: {
          &quot;moduleResolution&quot;: &quot;node&quot;,
          &quot;module&quot;: &quot;commonjs&quot;,
          &quot;lib&quot;: [&quot;dom&quot;, &quot;es2015&quot;, &quot;esnext&quot;],
          &quot;target&quot;: &quot;es5&quot;,
          /**
              svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
              to enforce using \`import type\` instead of \`import\` for Types.
              */
          &quot;importsNotUsedAsValues&quot;: &quot;error&quot;,
          &quot;isolatedModules&quot;: true,
          &quot;resolveJsonModule&quot;: true,
          /**
              To have warnings/errors of the Svelte compiler at the correct position,
              enable source maps by default.
              */
          &quot;sourceMap&quot;: true,
          &quot;esModuleInterop&quot;: true,
          &quot;skipLibCheck&quot;: true,
          &quot;forceConsistentCasingInFileNames&quot;: true,
          &quot;baseUrl&quot;: &quot;.&quot;,
          &quot;allowJs&quot;: true,
          &quot;checkJs&quot;: true,
          &quot;paths&quot;: {
              &quot;$lib/*&quot;: [&quot;src/lib/*&quot;]
          }
      },
      &quot;include&quot;: [&quot;src/**/*.d.ts&quot;, &quot;src/**/*.js&quot;, &quot;src/**/*.ts&quot;, &quot;src/**/*.svelte&quot;]
  }
  </code></pre>
  <p>sveltekit config:</p>
  <pre><code>import preprocess from 'svelte-preprocess'
  import ssr from '@sveltejs/adapter-static'
  
  /** @type {import('@sveltejs/kit').Config} */
  export default {
    preprocess: [
      preprocess({
        defaults: {
          style: 'postcss'
        },
        postcss: true
      })
    ],
  
    kit: {
      adapter: ssr(),
      target: '#svelte'
    }
  }
  </code></pre>