Hi,
I’d like to use the ‘require.js’ library in p5.js to load another library, say ‘fast-csv’
I’ve done locally:
- npm install fast-csv
- modify the index.html to include the ‘require’:
<script src=“https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js”></script>
- In the ‘sketch.js’ code:
var csv = require(’./node_modules/fast-csv’);
But I’m getting error:
Uncaught Error: Module name “node_modules/fast-csv” has not been loaded yet for context: _. Use require([])
https://requirejs.org/docs/errors.html#notloaded
at makeError (require.min.js:1)
at Object.s [as require] (require.min.js:1)
at requirejs (require.min.js:1)
at sketch.js:20
Could you help? Thanks a lot.
Xuepeng