webpack
ractive-component-loader forExports a Ractive component as a Ractive constructor function for webpack.
Usage
Quick start guide
Install this into your project:
$ npm install --save ractive-component-loader
Make all your .html
files compile down to [Ractive] templates by
modifying your webpack.config.js
file:
/* webpack.config.js */moduleexports = module: loaders: test: /\.html$/ loader: 'ractive-component' ...;
Then use your Ractive components via require()
:
<!-- mycomponent.html --> Hello {{subject}}! <!-- subcomponent.html -->Subcomponent are required correctly
var Component = ; el: documentbody ;
Alternate usage
You can also use it without modifying your config. Just explicitly call it on
your require()
call via a prefix:
var Component = ;
Thanks
ractive-component-loader © 2014+, Blake Thomson. Released under the MIT License.
Authored and maintained by Blake Thomson with help from contributors (list).