riot/riotify

How to use with bower?

Closed this issue · 7 comments

Hi.

I have installed riot from bower and using browserify.

When I'm trying transform with riotify,

var riot = require("../bower_components/riotjs/riot");

require("./dashboard.tag");
require("./navbar.tag");

I have problem:

➜  web git:(master) ✗ browserify -t riotify app/scripts/app.js
Error: Cannot find module 'riot' from '/Users/e/Development/Coiny/web/app/scripts'
    at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:51:17
    at process (/usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:159:43)
    at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:168:21
    at load (/usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:99:43)
    at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:105:22
    at /usr/local/lib/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at Object.oncomplete (fs.js:108:15)

My hierarchy:
screenshot 2015-02-09 13 28 12

Sorry. I have no idea how bower works, but from the error message, it seems like "riot" is not installed.

Yep, it's not in node_modules, but in app/bower_components/riotjs.

Then I don't think this is a riotify issue. riotify is just a transformer. It cannot tell browserify where to look for modules.

But it's work when I remove riotify. For example, when I delete line require("./dashboard.tag"), everything is ok, output.js is https://gist.github.com/theaqua/c5ee4db1ca2ea6cfc70c

@theaqua: Does browserify work with any other transformers, such as coffeeify? As in, have you managed to get bower to work with browserify and any other transformers?

Not sure if this makes sense (as I don't know bower), but have you tried bower install --save riotify ?

Thanks, I removed bower and install riot as npm dependency 😂.
Now it works fine!