Ractify Loader (for webpack)
Based on (and compatible with) ractify.
Installation
This loader does not depend on Ractive, you must require it yourself (this allows you to update Ractive without an update to ractify-loader).
Example:
npm install --save ractify-loader
npm install --save ractive@0.7
Usage / Examples
Webpack config example usage:
/* webpack.config.js */moduleexports = module: loaders: test: /\.ract$/ loader: 'ractify' ...
In your Client-side JavaScript, require('ractive/build/ractive.runtime')
and it'll import the runtime-only version of
ractive. require
a .ract
file, and it will return a plain javascript object with template
and (if defined) css
parameters:
var Ractive = var foo = template:template el: document data: ...
This structure can be passed into Ractive.extend
to automatically build Ractive components:
var Ractive = var Foo = Ractivevar foo = el: document data: ...
Extract partials by inspecting the template
property:
var foo = if footemplatepartials // foo.template.main has the main template // foo.template.partials has the partial templates
License
Open source software under the zlib license.