requirejs-riotcompile
AMD loader for riot.js tags
Install the plugin and its dependencies using bower
$ bower install requirejs-riotcompile --save
or using npm
$ npm install requirejs-riotcompile --save
Usage
To use require-riotcompile
you should set paths for Riot.js and requirejs-text
requirejs.config({
paths : {
riot : 'path/to/riot+compiler.js',
text : 'path/to/requirejs-text/text',
riotcompile: 'path/to/require-riotcompile/require-riotcompile'
}
});
To get precompiled tag, require it with riotcompile!
. As riotcompile
uses text
plugin, required file may have any extension(.html
, .tag
or anything else)
require('riot', 'riotcompile!./component.html', function(riot){
riot.mount('component');
});
Build
On build use stubModules
to stub text
and riotcompile
plugins
({
stubModules: ['text','riotcompile']
})
If necessary, you can set riot
path to version without compiler
({
paths: {
riot: 'path/to/riot.js'
}
})
License
MIT © Dmitriy Poluektov