Context:
I'm trying to get p5.js library working on a Wordpress installation build with Sage starter theme.
All files seems to be in their place:
p5.min.js is in dist folder.
p5.min.js is correctly enqueued at the end of the body:
<script type="text/javascript" src="//localhost:3000/app/themes/tlm/dist/scripts/p5.min.js"></script>
Problem:
When I try to create an instance of p5, I get 'p5' is not defined eslint error.
var sketch = function(p) {
p.setup = function () {
p.createCanvas(500, 500);
p.background(200);
};
};
new p5(sketch);
I have a low level of JS. Why p5 is undefined? How can I debug it?