voorhoede/riotjs-style-guide

extend "Module based development" with how to compile with "module definitions"?

jbmoelker opened this issue · 4 comments

Should we add to the "Module based development" guideline, that you can compile your tags to support AMD and CommonJS module definitions using riot --modular (riot -m)?

Riot Guide > AMD and CommonJS support:

Riot tags can be compiled with AMD (Asynchronous Module Definition) and CommonJS support. This configuration option is necessary if Riot is used with an AMD loader such as RequireJS or a CommonJS loader such as Browserify.

As a tip, yes, not a recommendation

@phortuin I agree on that. Just wondering if the "Module based development" guideline itself was not too high level to put something so specific there. I didn't know about the feature at first because its a bit hidden away, but is very useful when used in a larger setup using a module loader, for instance in test setup.

I think it fits perfectly, it helps devs adopt this guideline no matter their current module loading setup

Good. Will create a PR.