I am using p5.js library with webpack and it works just fine. However when I try to import createSlider
from p5.dom it fails
import p5 from "./p5";
import * as dom from './addons/p5.dom'
import {createSlider} from './addons/p5.dom'
const s = (p) => {
p.setup = function () {
p.createCanvas(200,200);
slider = createSlider(0, 360, 60, 40);
slider.position(10, 10);
slider.style('width', '80px');
};
};
let myp5 = new p5(s, 'p5cont');
I tried with dom.createSlider()
with no success. In both cases the console reports createSlider is not a function
.
What's wrong?