Skip to content

Instantly share code, notes, and snippets.

@yorgyetson
Last active August 31, 2021 21:22
Show Gist options
  • Save yorgyetson/0c5d6b6c663bb92e587a4fd5b8165a5f to your computer and use it in GitHub Desktop.
Save yorgyetson/0c5d6b6c663bb92e587a4fd5b8165a5f to your computer and use it in GitHub Desktop.
Sapper + svelte/gl
//index.svelte
let GLTest;
onMount(async () => {
const module = await import('../MyGLComponent.svelte');
GLTest = module.default;
});
<svelte:component this={GLTest} />
//rollup.config.js
import glslify from "rollup-plugin-glslify";
...
export default {
client: {
...
plugins: [
glslify(),
...
],
...
server: {
...
plugins: [
glslify(),
...
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment