This should help you test sass.js using Rhino.
Some notes:
- I have included a sample pom.xml in case you would like to use Maven. The important part is that I am using Rhino 1.7 (latest version).
- The TestRhino#main method initializes a Rhino context which loads the main.js module using CommonJs
- Create a "modules" directory anywhere in the application classpath. If using Maven to create the project, "src/main/resources" will be in the classpath by convention.
- Add main.js directly in the "modules" directory
- Clone sass.js in the "modules" directory. Basically, you will be able to require modules relative to the "modules" directory. In my main.js example, I copied "sass.js/dist" to "modules/sass".