Closed brunok closed 4 years ago
This saved me a lot of time! Thanks!
Thanks. Based on the project.json file. It should automatically be picked up now:
"main": "bundled/rough.cjs.js",
"module": "bin/rough.js",
"types": "bin/rough.d.ts",
"browser": "bundled/rough.js",
Also updated the docs. Thanks for reporting
Please complement the documentation for importing/requiring roughjs.
as says in :
But I didn't find any mention of the correct way to do it in the documentation. People used to node_modules will probably check out that folder and find the correct import, others could be quite lost.
so, for CommonJS:
const rough = require( 'roughjs/bundled/rough.cjs.js');
and for ES Modules:
import rough from 'roughjs/bundled/rough.esm.js';
Hope this helps