Search code examples
requirejsractivejs

How to disable RactiveJS's debug mode when using RequireJS?


I'm aware of the minifier snippet to disable RactiveJS's debug mode.

Ractive.DEBUG = /unminified/.test(function(){/*unminified*/});

However, I'm not sure where to add it if I use RequireJS since Ractive is not a global there. I tried using a shim configuration and change Ractive.DEBUG to false in a callback function, but then I run into problems using the rv plugin because RactiveJS is not supposed to work with shim?


Solution

  • I'd put it just north of wherever you call new Ractive(). Sorry, I don't know RequireJS, so I can't really suggest anything idiomatic.