Hi @micuat,
I’ve pushed the test file I was working on, to git here: GitHub - diogorsergio/p5-test
Can you have a look? To see if you can see whats happening? It would be really appreciated.
I was trying to use the require method to load a npm module nice-color-palettes
.
So when the p5 skech was working what I did was:
npm init
-
npm install nice-color-palettes
sketch.js is already requiring it. npm install --global browserify
browserify sketch.js > bundle.js
After
- Change index.html to load bundle.js instead of sketch.js.
- It loads the npm module sucessfuly, console is logging the array that it returns of colors, but the original sketch fails to load on the page.
- Change index.html back to sketch.js
- Npm module fails
sketch.js:1 Uncaught ReferenceError: require is not defined
, but now the sketch loads ok.
- Npm module fails
Thanks!