npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

systemjs-riot

v1.4.10

Published

RiotJS loader plugin for jspm/systemjs and requirejs

Downloads

25

Readme

Riot Tag Plugin for SystemJS and RequireJS

Build Status Code Climate npm

This is a loader plugin that enables to dynamically compile Riot tags from jspm/SystemJS or RequireJS and statically inline them during your build task.

Prior to version 1.2.0 the requirejs part of this loader was a separate project known as requirejs-riot, which is now deprecated in favor of this one.

Usage with JSPM/SystemJS

To use it you should install it with jspm:

jspm install tag

After that you can include Riot tags in your modules:

import riot from 'riot';
import 'app.tag!';

riot.mount('app');

You can also use it when defining AMD style modules, and combine it with the pluginFirst option of your SystemJS project to use it like:

define(['riot','tag!todo.tag'], function(riot) {
	riot.mount('todo');
    riot.route.start(true);
});

Usage with RequireJS

Install using npm like so:

npm install systemjs-riot

Add the proper config to your main requirejs.config. For example:

requirejs.config({
    paths: {
        "riot": "/node_modules/riot/riot+compiler.min",
        "tag": "../requirejs-riot",
        "tags": "./tags",
        "dist": "./dist"
    }
});

Then load your tags by prepending tag! to their path:

define(['riot','tag!timer.tag'], function(riot) {
	riot.mount('timer', {
        start: 0
    });
    riot.route.start(true);
});

Running examples

Install serve or any other basic webserver

make runexample

Then point your browser to http://localhost:3000/

Precompilation and Bundling

When you bundle or build your project, the tags will be precompiled and inlined as part of the process.

The make runexamples task does run make build, which uses both jspm and r.js to generate working bundles that you can inspect. The tasks run under the hood are:

for jspm:

jspm build 'tag!tags/todo.tag + tag!tags/timer.tag + tag!tags/app.tag - riot' example/dist/alltags.js --format umd

for the r.js optimizer

./node_modules/.bin/r.js -o example/requirejs.build.js

Tests

npm install
npm test