voorhoede / riotjs-style-guide

Opinionated RiotJS Style Guide for teams.
Creative Commons Zero v1.0 Universal
287 stars 22 forks source link

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

Closed jbmoelker closed 8 years ago

jbmoelker commented 8 years ago

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.

phortuin commented 8 years ago

As a tip, yes, not a recommendation

jbmoelker commented 8 years ago

@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.

phortuin commented 8 years ago

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

jbmoelker commented 8 years ago

Good. Will create a PR.