aboutsummaryrefslogtreecommitdiffstats
path: root/svelte.config.js
blob: bcb98108b64a2d4c814ab1b517b3c95ceabab664 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import adapter from './adapter/index.js';
import { sveltePreprocess } from 'svelte-preprocess';
import autoprefixer from 'autoprefixer';
import { transform } from 'esbuild';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: sveltePreprocess({
    postcss: {
      plugins: [autoprefixer()],
    },
    async typescript({ content, filename }) {
      const { code, map } = await transform(content, {
        loader: 'ts',
        format: 'esm',
        charset: 'utf8',
        color: true,
        treeShaking: false,
        keepNames: true,
        sourcefile: filename,
        tsconfigRaw: {
          compilerOptions: {
            preserveValueImports: true,
          },
        },
      });
      return { code, map };
    },
    sourceMap: process.env.NODE_ENV !== 'production',
  }),
  kit: {
    adapter: adapter({
      emptyOutDir: false,
      pages: 'build',
      assets: 'build',
      paths: {
        base: '.',
        app: 'uwu',
      },
    }),
    prerender: {
      concurrency: 16,
      handleHttpError: 'ignore',
    },
    appDir: 'uwu',
    output: {
      bundleStrategy: 'single',
    },
    embedded: true,
  },
};

export default config;