Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I bundle my tests which use Sinon.js using Rollup.js?

I'm using Rollup.js with plugins rollup-plugin-node-resolve and rollup-plugin-commonjs to bundle my tests, which use Sinon.js. When I try to run the bundled file I get the following error:

Error: Dynamic requires are not currently supported by rollup-plugin-commonjs

Is there any workaround for this error, or do I have to use some other tool like Webpack?

like image 727
Michał Perłakowski Avatar asked Oct 30 '16 22:10

Michał Perłakowski


1 Answers

Sinon.js v1.x doesn't work with bundlers like Rollup.js. You should upgrade to a newer version (v2.x or later).

like image 165
Michał Perłakowski Avatar answered Oct 23 '22 02:10

Michał Perłakowski