hij1nx/weld — Issue #39: Weld doesn't work with JS bundlers built on node.
Author: dsego
Created: 2011-11-09 18:59:48+00:00
State: open

I'm trying to use weld with Spine ( http://spinejs.com/). Spine apps are built with Hem. What is Hem?

_"Hem is a dependency management tool for JavaScript Web apps; you can think of it as Bundler for Web Apps, resolving all the dependencies and compiling your application up to be served to clients.
...
Hem will recursively resolve any external Node modules your code references. This means that Spine, jQuery etc, can all be external Node modules..."_

This is what I think is happening. When I add _require('weld')_, hem processes the weld code and finds the _ require('tty')_ call. Then it tries to solve the dependency by trying to find the module and parse the file. That's when it fails with: "Cannot find module: tty.", since tty is built-in, I guess.

I'm not sure whether Weld or Hem is the place to fix this. Is detecting nodejs even used for anything except debugging? Maybe a setting to enable/disable node or browser debugging would be a better solution?