-
Notifications
You must be signed in to change notification settings - Fork 8
Requiring PogoScripts
To require a script written in pogo, just require the filename without the .pogo extension, for example if you had a pogo file called stuff.pogo, then you'd require it like this:
stuff = require './stuff'
require will look for and find the file stuff.pogo in the same directory.
This also works if you happen to compile both stuff.pogo and the file you required it from. Both files turn into .js files, and Node just finds them, just as it does with normal JavaScript.
The only thing to keep in mind is that if you have both stuff.js and stuff.pogo in the directory, Node will use the stuff.js file. This can be confusing when you've made changes to the .pogo file and they don't seem to have had any effect. In this case, either recompile or remove the .js.
According to the documentation, you can have Closure Compiler add the sourceMappingURL to the bottom of the script with something like this:
--output_wrapper "%output%
//# sourceMappingURL=output.js.map"being added to your call. Not that you cannot use "\n" here, and you need a newline literal. On a Linux shell this works just fine (if you're inside of quotes when you press enter, the command doesn't get executed).