#svelte.config.js? Using Threlte with astro

3 messages · Page 1 of 1 (latest)

lament sentinel
#

A Threejs svelte library - threlte requires to add the following to the svelte.config.js. How would I go about making this work in Astro?
https://threlte.xyz/getting-started#configuration


///svelte.config.js

import preprocess from 'svelte-preprocess'
import seqPreprocessor from 'svelte-sequential-preprocessor'
import { preprocessThrelte } from '@threlte/preprocess'

const config = {
    // …
    preprocess: seqPreprocessor([preprocess(), preprocessThrelte()])
}

export default config
#

My astro.config.mjs

import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";

import preprocess from "svelte-preprocess";
import seqPreprocessor from "svelte-sequential-preprocessor";
import { preprocessThrelte } from "@threlte/preprocess";

// https://astro.build/config
import svelte from "@astrojs/svelte";

// https://astro.build/config
export default defineConfig({
  integrations: [
    tailwind(),
    svelte({
      preprocess: seqPreprocessor([preprocess(), preprocessThrelte()]),
    }),
  ],
  vite: {
    ssr: {
      noExternal: ["three", "troika-three-text"],
    },
  },
});
#

Getting : markup.update is not a function