dcodeIO / Preprocessor.js

A JavaScript source file preprocessor in pure JavaScript, e.g. to build different versions of a library.
http://dcode.io
Apache License 2.0
72 stars 19 forks source link

Adding support for including a file only once with 'require' #7

Closed bgmort closed 10 years ago

bgmort commented 10 years ago

It would be quite handy to be able to include a file only once when it is referenced from multiple files. I've added this support using 'require'. It works like node's require, or PHP's require_once.

dcodeIO commented 10 years ago

I think it's a good idea to have it. I'd just suggest to name it "include_once".

bgmort commented 10 years ago

This is my first pull request. Is it better if I make the change before you pull or if you make it after?

dcodeIO commented 10 years ago

It's OK either way. I changed it, thanks!