This page shows a few RequireJS use cases including:
Open the source code starting from index.html and follow the comments labeled "Step 1 -" to "Step 8-".