paularmstrong/swig — Issue #28: Add support for Ender
Author: naholyr
Created: 2011-12-30 00:47:23+00:00
State: open

Hello,

It would be nice to be able to `ender add swig` to enjoy the browser version integrated in my Ender build.

I've checked out your code and the only way I can see to properly do this is:

* Add a post-install script that generates a `ender.js` file the way `browser.sh` generates its `swig.js`.
* Add `"ender": "ender.js"` to your `package.json`, to reference this generated file. Note that the script generating `ender.js` should be run by node and not a given shell, to ensure compatibility with Windows ;).
* This way, `ender add swig` would integrate main script (`index.js`) and append `ender.js` (which would include currently appended scripts in the browser version) → win !

The resulting `ender.js` would be something like this:

```javascript
!function ($) {

// append dateformat.js

// append filters.js

// append helpers.js

// append parser.js

// append tags.js

$.ender({ swig: require('swig') })
}(ender);
```

I've tried to achieve this, but I can't manage to make it fully working. Anyway it's obviously the way to go.