I have a standard Sapper project like that:
routes
├── application
├──- index.svelte
├──- _brush.js
├──- (...etc)
I wish to install the library 'dat.gui' to my project and I have installed:$ npm install --save dat.gui with success.
<script>
import { onMount } from 'svelte';
import { Brush } from './_brush.js';
import * as dat from 'dat.gui';
// dat.GUI
let brushParams = { ... my chosen params}
onMount(()=> {
// loading dat.GUI
let gui = new dat.GUI();
console.log(gui);
}
The Sapper application keeps crashing all the time with the following message: ReferenceError: window is not defined at Object...etc.
Which should be the right way to import a library like that into sapperjs ? Thank you