riot-starter/docs/modules.md

12 lines
671 B
Markdown
Raw Normal View History

2019-07-20 23:06:06 +00:00
# Module System
2019-07-21 20:59:34 +00:00
ES6 Modules just dont work *well* inside `RiotJS` tags (`<=3`), you could include them at the top of the page, but that requries a build-*watch*-proccess that goes against -- a **zero-build** develop process!
2019-07-20 23:06:06 +00:00
2019-07-21 20:59:34 +00:00
**Mixins** is Riots answer to shared / resultable componet logic, but you want an easy way to compose larger bits of logic before they were injected into `riot.mixin`, that is why the build process (gulp) treats javascript files differently.
2019-07-20 23:06:06 +00:00
2019-07-21 20:59:34 +00:00
While using ES Modules for application logic, tags need to be built separately.
2019-07-20 23:06:06 +00:00
2019-07-21 20:59:34 +00:00
- Tags are build with Riot, and minified
- Application JS is built with Rollup, and minified (iife format)
2019-07-20 23:06:06 +00:00