evanmoran / oj

Unified web templating for the people. Thirsty people.
MIT License
445 stars 7 forks source link

Using OJ with Browserify #16

Closed brod-ie closed 9 years ago

brod-ie commented 9 years ago

I've read in PR history that this lib supports Browserify but I can't find a working example. I'm trying:

oj = window.oj = require "ojs"

With Error: Cannot find module './oj.coffee' from '/path/to/node_modules/ojs/dist'. I've tried requiring ojs/dist/OJ but again, no luck.

evanmoran commented 9 years ago

It actually replaces Browserify, not uses it=). Just run oj on the commandline to build your site and require everything normally and it will just work.

The easiest way to setup OJ is with yeoman.

npm install -g oj
npm install -g yo
npm install -g generator-oj
yo oj

Let me know if you have issues!

brod-ie commented 9 years ago

I use Gulp to build my files, in this case how do I use OJ?